Online since 2002. Over 3300 puzzles, 2600 worldwide members, and 270,000 messages.

TwistyPuzzles.com Forum
 It is currently Tue Jul 22, 2014 8:11 pm

 All times are UTC - 5 hours

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Looking for high-precision Octal Calculator.Posted: Thu Apr 18, 2013 3:54 pm

Joined: Sun Nov 23, 2008 2:18 am
Okay, I want to play around with taking various mathematical constants and intepreting them as music via the following method:
1. Taking the numbers digits in base 8.
2. Replacing 0s with Cs, 1s with Ds, etc.(7 becomes the C one octave higher).
3. using the first digit to set the octave to play in(thinking a Piano's roughly 8 octave range).

Of course, to do this, I need a way of calculating numbers in octal to a precision that gives a suitable number of notes to work with. I already found a webpage that includes the fir 100 digits of pi in octal, but I would also like to take a listen to pi/2, tau, phi, phi^2, phi ^3, e, sqrt(2), and any others I come up with.

Ideally, a Linux command line program that could output the answers to mathematical expressions in octal to a precision of a few dozen digits would be nice, but I will take anything that I can either use from the command line or from within a web browser(with me still recovering from a detached retina, graphical apps other than firefox are beyond my reach).

_________________
Just so you know, I am blind.

I pledge allegiance to the whole of humanity, and to the world in which we live: one people under the heavens, indivisible, with Liberty and Equality for all.

My Shapeways Shop

Top

 Post subject: Re: Looking for high-precision Octal Calculator.Posted: Thu Apr 18, 2013 4:12 pm

Joined: Thu Dec 31, 2009 8:54 pm
Location: Bay Area, California
This is pretty easy with PARI/GP

I use "gp" for almost everything because it's so fast and arbitrary precision.

gp understands decimal and can convert to binary for you so that makes all the power-of-two bases trivial.

For example, here is Pi in binary:

Code:
? Pi
%1 = 3.1415926535897932384626433832795028842
? binary(Pi)
%2 = [[1, 1], [0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1]]

If you want Pi in octal just take groups of 3 binary digits.

You can dial up the precision as much as you want. A million decimal digits of Pi can be achieved with:
Code:
? \p 1000000
realprecision = 1000016 significant digits (1000000 digits displayed)
? Pi
%3 (1 million digits here)

You can get e by using exp(1). Here are 100 decimal digits:
Code:
? \p 100
realprecision = 115 significant digits (100 digits displayed)
? exp(1)
%3 = 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427

Phi is also easy:
Code:
? phi = (1 + sqrt(5)) / 2
%4 = 1.618033988749894848204586834365638117720309179805762862135448622705260462818902449707207204189391137

For exotic constants you may need to script gp to expand a taylor series or similar. Then figuring out how far you have to go for your desired precision will take some math on your part.

_________________
Prior to using my real name I posted under the account named bmenrigh.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC - 5 hours