Sunday, December 30, 2012

Java fix

For the factorization of large integers I have become somewhat dependent on factordb.com and Dario Alpern's ECM Java applet. With my new Mac/OS I have, so far, gone without the latter but today I enabled Java in my web browser, only to find that my large numbers would not paste into the ECM app, nor could I copy any factors out of it. After a little searching, I finally came up with a fix: I downloaded Alpern's ECM source code, opened Terminal, gave the ECM folder-location path (using the cd command), compiled it (javac ecm.java), and ran it (java ecm). The applet appears sans browser and copy/paste work fine.

Friday, December 28, 2012

Pi continued fraction & Khinchin: regimes

Let the 'reduced geometric mean' be the geometric mean minus Khinchin (k). The first 25 reduced geometric means for the fractional part of π are:

 1 7-k                                              =  4.3145..
 2 105^(1/2)-k                                      =  7.5615..
 3 105^(1/3)-k                                      =  2.0322..
 4 2^(1/2)*7665^(1/4)-k                             = 10.5471.. max
 5 2^(2/5)*7665^(1/5)-k                             =  5.2088..
 6 2^(1/3)*7665^(1/6)-k                             =  2.9090..
 7 2^(2/7)*7665^(1/7)-k                             =  1.6891..
 8 2^(3/8)*7665^(1/8)-k                             =  1.2814..
 9 2^(1/3)*7665^(1/9)-k                             =  0.7182..
10 2^(3/10)*3^(1/5)*2555^(1/10)-k                   =  0.6755..
11 2^(3/11)*3^(2/11)*2555^(1/11)-k                  =  0.3248..
12 2^(1/3)*21^(1/6)*365^(1/12)-k                    =  0.7362..
13 2^(5/13)*21^(2/13)*365^(1/13)-k                  =  0.5977..
14 2^(5/14)*21^(1/7)*365^(1/14)-k                   =  0.3304..
15 2^(1/3)*21^(2/15)*365^(1/15)-k                   =  0.1164..
16 2^(3/8)*21^(1/8)*365^(1/16)-k                    =  0.0580..
17 2^(7/17)*21^(2/17)*365^(1/17)-k                  =  0.0075..
18 2^(4/9)*21^(1/9)*365^(1/18)-k                    = -0.0366..
19 2^(9/19)*21^(2/19)*365^(1/19)-k                  = -0.0755..
20 2^(9/20)*21^(1/10)*365^(1/20)-k                  = -0.1977.. max
21 2^(11/21)*21^(1/7)*365^(1/21)-k                  =  0.2561.. max
22 2^(6/11)*21^(3/22)*365^(1/22)-k                  =  0.2050..
23 2^(12/23)*21^(3/23)*365^(1/23)-k                 =  0.0746..
24 2^(1/2)*21^(1/8)*365^(1/24)-k                    = -0.0396.. max
25 2^(12/25)*3^(4/25)*5^(2/25)*7^(3/25)*73^(1/25)-k =  0.1504..

Notice that 1-17 and 21-23 are positive, while 18-20 and 24 are negative. Each one of these alternating-sign regimes has a maximum (distance from k): for instance, {20, 0.1977..} for the negative 18-20 regime. I have now calculated the start, end, and maximum for the first 27087 regimes (the final one incomplete because it ends beyond 3*10^9). Some regimes are quite lengthy, such as the positive 5418849-1434927964 and 1865143624->3*10^9. The so-far maximum in that final one is {2377934394, 0.00004194392..}, meaning that the geometric mean of 976 terms is closer to Khinchin than the geometric mean of 2377934394 terms!

[Fred Lunnon was kind enough to point me to Chapter III of William Feller's An Introduction to Probability Theory and its Applications (Volume 1) as a means of understanding some of the mathematics involved in all this.]

Thursday, December 27, 2012

Pi continued fraction & Khinchin

As stated in my last entry, I am now able to compute billions of continued fraction terms for arbitrary constants. In fact, using my current setup, I have already charted over three billion such terms for the constant π. (Because of memory constraints, an attempt at four billion terms failed.)

There are a number of things an empiricist can do with such a collection: tally it (these occurrence counts are for exactly 3 billion terms), find the position of first occurrence, and the position of the nth occurrence, of n. (All three of these exclude the initial 3, because the initial — the zeroth — term of of a simple continued fraction may be any integer but the rest are strictly positive. This is why I do not like the Applications example in the Khinchin entry of the Mathematica documentation center.)

Additionally, what I did back in 2001 (with a measly 53 million terms) was generate a π Khinchin-approach sequence: A059101, with 27 terms. Today I added terms #28 to #36.

Tuesday, December 18, 2012

Home, sweet home

Yesterday, the replacement for my nine-year-old dual 2-GHz Power-PC G5 arrived and — as suggested in the final entry of my old blog — in the wee hours of this morning I purchased and subsequently downloaded the home edition of Mathematica 9.

The 27" iMac (2012) had been maxed out with what I could add at the Apple store, with the exception of 32 GB RAM which I had ordered from a third party and installed myself.

For the most part the setup went smoothly. I had to figure out how to do my web-sharing, resolve a will-not-fetch-mail issue, and resign myself to not using Java for now. I booted up Mathematica and asked for $MaxNumber. It suggested: 8.768126706828697*10^2711437152599256. So I knew I could do a lot better than the 180 million terms of the pi continued-fraction generated back in 2002. Requesting one billion terms, the calculation required just over one hour!

Saturday, December 15, 2012

Time wasted

Since November 19, I've been trying to find the eighth term of A219325 and have only just managed to get up to five billion. Giovanni Resta has now beat me to it with 34505916416. The binary circulant that results from this number is:

1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0
0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0
0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1

Friday, December 07, 2012

Keyboards

Design — as Apple (of all companies) should know — is how it works. When Tim Cook was asked recently how adept he was at using Apple's virtual keyboard, he replied: "Pretty good. I think if you stick with it a little while you get quite good at it. And the auto correction is quite good." Ouch!

Apple's virtual keyboard suffers of course from a fundamental design flaw. It fails to adequately mimic an actual keyboard by splitting it into two discrete entities, the second of which sports the numbers and some much-used punctuation (such as the apostrophe and the hyphen). This becomes a difficult-to-ignore annoyance in message chats on my iPad and would be relatively easy to fix with a properly designed, replacement virtual keyboard. I'm aware of course that space/size concerns might limit what is reasonably possible but intelligent designers would figure out a way. The reason they have not done so (unless perhaps there is a design disconnect at Apple these days) surely is to steer folk into Apple's $70 wireless keyboard accessory solution!

So, in order to better enjoy my iPad Messages chats, I purchased an Apple wireless keyboard. The first thing I grappled with was why there wasn't an obvious on/off indicator light on the keyboard. This design flaw may be overcome by noting that the caps-lock light will not come on when the keyboard is off (an extra and surely unnecessary step). The second thing I dealt with is that there is no way to send my wireless-keyboard typed blurbs without touching the Send button on the iPad. This is of course an easily fixed software limitation — except that Apple hasn't addressed the issue in the several years that people have been complaining about it! Maybe Apple really has lost its design moxie.