Basic
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
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
-
- Posts: 49
- Joined: Fri Jul 02, 2010 9:34 pm
- Location: Egypt
- Contact:
-
- Posts: 1
- Joined: Fri Sep 18, 2009 10:01 am
i know java is normaly realy gabby, but this was quit short:
But the real challenge is to code the convertion by yourself. I try it soon.
Code: Select all
return new BigInteger("28679718602997181072337614380936720482949").toString(7);
-
- Posts: 5
- Joined: Sun Mar 11, 2012 2:57 pm
- Contact:
I wrote an own function in python (for fun)
It returns a list of the digets.
Code: Select all
def base(number,base):
newnumber=[]
while number>0:
newnumber.insert(0,number%base)
number=number//base
return newnumber
-
- Posts: 1
- Joined: Thu Feb 14, 2013 10:43 am
How in C
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???
Is there any Header file which support integers with such large digits???
-
- Forum Admin
- Posts: 496
- Joined: Sat May 28, 2011 9:14 am
- Location: Germany
There are "big integer" libraries which can be used with C. One of them is the GNU Multiple Precision Arithmetic Library.
-
- Posts: 12
- Joined: Sun Oct 26, 2008 4:33 pm
Thanks Mathematica
Code: Select all
BaseForm [28679718602997181072337614380936720482949, 7]
I solved it in groovy in straight forward programing
But after reading the solution of wolfamstart in this Forum I recognized, that groovy also provides a very quick solution:
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--
}
Code: Select all
println 28679718602997181072337614380936720482949.toString(7)