My Math Forum  

Go Back   My Math Forum > College Math Forum > Number Theory

Number Theory Number Theory Math Forum


Reply
 
LinkBack Thread Tools Display Modes
June 19th, 2009, 08:36 PM   #1
Newbie
 
Joined: Jun 2009

Posts: 6
Thanks: 0

Calculator Question

Hello,

Does anyone know of a calculator, preferably online, that will calculate to at least 50 or so decimal places? I would like to convert phi to a base 12 number with at least 45 duodecimal places. I've done some searching, but I still haven't found a calculator that is better than the Windows calculator which calculates to about 30 decimal places.

Thank you.
at phi is offline  
 
June 19th, 2009, 08:47 PM   #2
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 937

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Calculator Question

Check my .sig.
CRGreathouse is offline  
June 19th, 2009, 09:11 PM   #3
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 937

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Calculator Question

I hacked together some code for converting to duodecimal for you:
Code:
duodigit(n)=["0","1","2","3","4","5","6","7","8","9","A","B"][n+1]
duoint(n)=my(out="");if(n<=0,return(if(n<0,concat("-",duoint(-n)),"0")));while(n>0,out=concat(duodigit(n%12),out);n\=12);out
duodecimal(x)=my(out=duodigit(if(x<0,-floor(-x),floor(x))),k);if(x==floor(x),return(out));out=concat(out,".");k=floor(precision(x)*log(10)/log(12)-2);for(i=1,k,x=(x-floor(x))*12;out=concat(out,duodigit(floor(x))));out
You can just copy this and past it into Pari. (You'll need to turn on QuickEdit mode if you're using Windows: right-click the shortcut to Pari, choose Properties, and check "QuickEdit" on one of the tabs, I forget what it's called, maybe the second tab. This lets you paste by right-clicking, very useful.) Then it's just two commands to get phi to lots of decimal places. First, change the precision to (say) 100 decimal places:
Code:
\p 100
Then calculate phi, converting to duodecimal with my script above:
Code:
duodecimal((1 + sqrt(5))/2)
CRGreathouse is offline  
June 19th, 2009, 09:43 PM   #4
Newbie
 
Joined: Jun 2009

Posts: 6
Thanks: 0

Re: Calculator Question

Thanks for the response! Unfortunately I don't have a computer that I can download PARI to. Would it be too much for me to ask for you to post phi in base 12 to however many places you can stand to calculate?

Thanks again.
at phi is offline  
June 19th, 2009, 10:05 PM   #5
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 937

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Calculator Question

Quote:
Originally Posted by at phi
Thanks for the response! Unfortunately I don't have a computer that I can download PARI to.
Are you at an Internet cafe or something?

Quote:
Originally Posted by at phi
Would it be too much for me to ask for you to post phi in base 12 to however many places you can stand to calculate?
My code isn't optimized for large numbers of digits, but I'm attaching a zip file of 7 seconds' worth of calculation, about 9200 duodecimal digits.
CRGreathouse is offline  
June 19th, 2009, 10:18 PM   #6
Newbie
 
Joined: Jun 2009

Posts: 6
Thanks: 0

Re: Calculator Question

Actually, I tried to download PARI but the install file is a GZ file which I can't open because I don't have WinZip. Eventually, I'll probably just buy WinZip so that I can install PARI.

Thanks a ton for the file! That helps a lot.
at phi is offline  
June 19th, 2009, 10:21 PM   #7
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 937

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Calculator Question

Quote:
Originally Posted by at phi
Actually, I tried to download PARI but the install file is a GZ file which I can't open because I don't have WinZip. Eventually, I'll probably just buy WinZip so that I can install PARI.
You're doing it wrong! You need to download the Windows binary. Even if you could read the .tar.gz file (which you could... download 7zip, it's free and better than WinZip) you couldn't do anything with it. Edit: I edited my .sig to include a direct link to the binary.

Pari/GP is *really* worth it. You have no idea how easy it makes questions like this.
CRGreathouse is offline  
June 19th, 2009, 10:57 PM   #8
Newbie
 
Joined: Jun 2009

Posts: 6
Thanks: 0

Re: Calculator Question

Great; I got PARI installed now. I'm sure I'll have a bit of a learning curve to go through before I can really utilize the program but I know this will help me out with a lot of stuff.

Thanks!
at phi is offline  
June 19th, 2009, 11:15 PM   #9
Newbie
 
Joined: Jun 2009

Posts: 6
Thanks: 0

Re: Calculator Question

So, after I've defined the duodecimal function (or any function), is there any way to get PARI to retain the function after I close the program? It seems that it wipes out the function after I close PARI and re-open.
at phi is offline  
June 19th, 2009, 11:17 PM   #10
Global Moderator
 
CRGreathouse's Avatar
 
Joined: Nov 2006
From: UTC -5

Posts: 16,046
Thanks: 937

Math Focus: Number theory, computational mathematics, combinatorics, FOM, symbolic logic, TCS, algorithms
Re: Calculator Question

Quote:
Originally Posted by at phi
Great; I got PARI installed now. I'm sure I'll have a bit of a learning curve to go through before I can really utilize the program but I know this will help me out with a lot of stuff.
A bit, but not as much as you'd think. The basics are pretty much the same as the standard plan-text math conventions:
1+1
2^7+3/2
7%2 (the remainder of 7 when divided by 2)
10!

Then you just pick up named functions that apply to you:
isprime(3^494+2)
zeta(3)
factor(20!+1)

Looping functions are also good:
for(k=1,10,print(k))
sum(n=1,10,n^2)
forprime(p=2,100,print1(p" "))
forstep(n=3,21,2,print1(n", "))
CRGreathouse is offline  
Reply

  My Math Forum > College Math Forum > Number Theory

Tags
calculator, question



Search tags for this page
Click on a term to search for related topics.
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about a calculator button Eureka Math Software 6 February 6th, 2012 06:30 AM
Calculator question: solving for Y in TI-83 Dan154 Math Software 6 January 12th, 2012 05:41 AM
TI30x calculator question rowdy3 Calculus 1 September 8th, 2011 11:13 AM
Calculator question: solving for Y in TI-83 Dan154 Algebra 1 December 31st, 1969 04:00 PM
small question how to find powers with out calculator jamescsi Calculus 0 December 31st, 1969 04:00 PM





Copyright © 2017 My Math Forum. All rights reserved.