Basic

Discussion of challenges you have already solved
Post Reply
Lasdem
Posts: 4
Joined: Tue Dec 16, 2008 9:44 am

Basic

Post by Lasdem »

Now that WolframAlpha is available,
this chellange got very easy =)[/url]

Don't know what i mean?
click me[/url]
megabreit
Posts: 141
Joined: Sat Jan 03, 2009 3:33 pm

Post by megabreit »

It was easy for UNIX users long before that.
Check bc and the obase command:
$ bc
obase=7; 8
11

WolframAlpha is an amazing site, but can probably not solve most of the harder math challenges.
E.g. "Biggest Fib" runs into an timeout. You don't need a calculator anymore, but still have to use your own brain :shock:
matter
Posts: 11
Joined: Mon Oct 12, 2009 7:30 am

Post by matter »

Yea, I used the BC libraries in PHP. Code was about 5 lines.
Aghamemnon
Posts: 49
Joined: Fri Jul 02, 2010 9:34 pm
Location: Egypt
Contact:

Post by Aghamemnon »

I solved it by hand
just for fun
These things amuse me
:twisted: Devilish Angel Aghamemnon :twisted:
chephy
Posts: 17
Joined: Sat Oct 16, 2010 4:39 pm

Post by chephy »

matter wrote:Yea, I used the BC libraries in PHP. Code was about 5 lines.
5 lines? Ruby: »28679718602997181072337614380936720482949.to_s 7«
wolfamstart
Posts: 1
Joined: Fri Sep 18, 2009 10:01 am

Post by wolfamstart »

i know java is normaly realy gabby, but this was quit short:

Code: Select all

return new BigInteger("28679718602997181072337614380936720482949").toString(7); 
But the real challenge is to code the convertion by yourself. I try it soon.
FreeFull
Posts: 7
Joined: Fri Apr 22, 2011 6:26 pm

Post by FreeFull »

I used dc
User avatar
laz0r
Posts: 290
Joined: Thu Feb 04, 2010 4:18 pm
Location: Within the depths of Unix

Post by laz0r »

Mathematica:

IntegerString[28679718602997181072337614380936720482949, 7]
There is no spoon.
the_austria
Posts: 5
Joined: Sun Mar 11, 2012 2:57 pm
Contact:

Post by the_austria »

I wrote an own function in python (for fun)

Code: Select all

def base(number,base):
  newnumber=[]
  while number>0:
    newnumber.insert(0,number%base)
    number=number//base
  return newnumber
It returns a list of the digets.
DHARMENDRA VERMA
Posts: 1
Joined: Thu Feb 14, 2013 10:43 am

How in C

Post by DHARMENDRA VERMA »

i solve this problem in java but i am wondering that how could I solve this in C ??
Is there any Header file which support integers with such large digits???
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post by AMindForeverVoyaging »

There are "big integer" libraries which can be used with C. One of them is the GNU Multiple Precision Arithmetic Library.
Schnapphahn
Posts: 12
Joined: Sun Oct 26, 2008 4:33 pm

Post by Schnapphahn »

Thanks Mathematica

Code: Select all

BaseForm [28679718602997181072337614380936720482949, 7]
User avatar
Grusewolf
Posts: 16
Joined: Sun May 29, 2011 7:58 pm
Location: Munich

Post by Grusewolf »

I solved it in groovy in straight forward programing

Code: Select all

BigInteger number = 28679718602997181072337614380936720482949
def pow = 50
print "septal number: "
while(pow >= 0) {
    def digitValue = 7.power(pow)
    def currentDigit = 0
    while(number >= digitValue) {
        currentDigit++
        number -= digitValue
    }
    print currentDigit
    pow--
}
But after reading the solution of wolfamstart in this Forum I recognized, that groovy also provides a very quick solution:

Code: Select all

println 28679718602997181072337614380936720482949.toString(7)
Post Reply