I've added Bill Gosper's Mma code to A129935. Phil, does your Pari code need any changes? If so, could you make them please? Thanks! Neil On Sun, Mar 17, 2013 at 1:33 AM, Bill Gosper <billgosper@gmail.com> wrote:
Among the first 50000 terms of 2/ln 2, the eight largest are In[83]:=tim[TableForm[Function[cf, ({#1, cf[[#1]]} &)[Ordering[cf, -8]]][ ContinuedFraction[2/Log[2], 50000]]]]
During evaluation of In[83]:= 0.027915
Out[83]// 1253rd 36652nd 6560 10806 12500 21176 46177th 9154th
5491 6232 9429 11823 21601 89790 1897631 1927330
(tim is a timer. How the he<< does Mma do this in 28ms? Must cache like crazy from earlier.)
Long arithmetic bursts in A(n) immediately precede large terms, but only those of odd index.
E.g. the 9154th produces nothing, but tim[Block[{t = Sort[tim[Convergents[2/Log[2], 46177 - 2][[-2 ;; -1]]]], nd = {Numerator[#], Denominator[#]} &}, For[{lo = nd[t[[1]]], hi = nd[t[[2]]], nu = {1, 1}, n = 0}, n < 3, nu = lo + hi; For[{k = nu[[2]]}, Floor[k*2/Log[2]] != Ceiling[2/(2^(1/k) - 1)], k += nu[[2]], Print[{++n, N[k]}]]; If[nu[[1]]*Log[2] > 2*nu[[2]], hi = nu, lo = nu]]]]
1.245744
{1,2.647431972132282*10^23952} {2,5.294863944264564*10^23952} {3,7.942295916396846*10^23952} ... {467,1.236350730985776*10^23955} {468,1.238998162957908*10^23955}
37.626771
produces a burst of 468 anticipating the term 1897631. In[90]:= Log[468, 1897631.] Out[90]= 2.35117
In[94]:= π^2/6./Log[2]
Out[94]= 2.37314 ? --rwg
On Thu, Mar 14, 2013 at 11:04 PM, Bill Gosper <billgosper@gmail.com> wrote:
OK, things are clearer now. We find no disagreement between PARI and Mma if we avoid $MaxExtraPrecision=∞ in 9.0.1 and probably 9.0. (Neil got screwed by insufficient realprecision in PARI) This 9.0.1 code, $MaxExtraPrecision = 999999999; For[{lo = {0, 1}, hi = {1, 0}, nu = {0, 0}, n = 0}, nu[[2]] < 10^386, nu = lo + hi; For[{k = nu[[2]]}, Floor[k*2/Log[2]] != Ceiling[2/(2^(1/k) - 1)], k += nu[[2]], Print[{++n, k}]]; If[nu[[1]]*Log[2] > 2*nu[[2]], hi = nu, lo = nu]]
reproduces the hundred values in http://oeis.org/A129935/b129935.txt , and probably works up to around half a billion digits. When Mathematica gets fixed, change 999999999 to ∞. Assuming the CF of 2/ln 2 has the usual Log[2,1+tail] statistics, one might expect this Mma program to be asymptotically abysmal, since it is isomorphic to a Euclid process using subtract vs divide. But instead of stalling at the huge terms, it pumps out lots of denominators (A(n)) in arithmetic progression. --rwg Note that Mathematica does not force you to prespecify a precision that will cost you if too large, and screw you if too small. Macsyma had a similar scheme for comparing exact quantities with heuristic_precision_limit, but 2.4, at least, has woefully small compiled-in integer limits. Mathematica also warns of insufficient $MaxExtraPrecision. Except in my 9.0.1, which for some reason doesn't even complain of unbalanced brackets. ?
On Thu, Mar 14, 2013 at 2:12 AM, Bill Gosper <billgosper@gmail.com> wrote:
NJAS>Bill, It seems that you are saying that A129935 should be corrected, but I don't quite follow what should be changed. This comes to me as a message from the cloud, and I will do whatever you say. What should be changed? Neil
Neil, I'm not sure yet. The PARI code is wrong since it misses confirmed values among the first 100, so there's not much point in adding equivalent Mathematica code with the same bug. We need an algorithm, perhaps from Max Alekseyev and Robert Gerbicz, and presumably based more adaptively on the continued fraction of 2/ln 2. But even if we find one, it may be impossible at this time to give a correct program, because of the Mma 9.0.1 bug, and a new discrepancy Neil B. seems to have found between Mathematica 8.04 and PARI! We may need to add warnings that, as of March 2013, the programs fail for certain large n due to implementation bugs. Or if Maple or Maxima works, we can just punt the code for the flaky CAS(es). --Bill
On Wed, Mar 13, 2013 at 9:18 PM, Bill Gosper <billgosper@gmail.com> wrote: On 2013-02-27, at 3:05 PM, Bill Gosper wrote: Sum[2^k/(1 + z^2^k), {k, -Infinity, Infinity}] == 1/Log[z] Can somebody tell me where? --rwg And, as Neil [B.] empiricizes, Sum[2^k/(1 + z^2^k), {k, 0, Infinity}] == 1/(z-1)
MRob>This reminds me of something Neil Sloane mentions in his OEIS talks, namely that the function f(n) = floor(2n/log(2)) has the same value as the function g(n) = ceiling(2/(2^(1/n)-1)) (Sloane's sequence A78608) for all integer n from 1 to [7]77451915729367, but differs at n=[7]77451915729368 (and at some other larger values, see oeis.org/A129935). --------------------------
rwg>Neil B. points out that Phil's PARI code misses eleven entries in http://oeis.org/A129935/b129935.txt, and suggests 13*cand (or larger) instead of 2*cand in
default(realprecision, 500); c=contfrac(log(2)/2); for(n=2, #c, cand=contfracpnqn(vecextract(c, 2^n-1))[1, 1]; forstep(m=cand, 2*cand, cand, if(ceil(2/(2^(1/m)-1)) != floor(2*m/log(2)), print(m))))
13, [or] even 20, is in turn insufficient for longer tables. 20 gives 638215591788186030688409<<5153>>7190350518178849343531561 as A(1520), but 26 gives it as A(1527). Is there any finite alternative to 26 that works indefinitely? If not, what is a correct algorithm here? This may relate to the startling interludes of slow, arithmetic growth at, e.g., A(56)-A(68). Here is equivalent Mma code:
$MaxExtraPrecision = 999999999; Select[Flatten[ Transpose[Outer[Times, Range[26], Denominator@Convergents[2/Log[2], 9999]]]], Floor[2*#/Log[2]] != Ceiling[2/(2^(1/#) - 1)] &]; This should really say $MaxExtraPrecision = ∞ but that tickles a numerics bug in the current version (9.0.1). --rwg
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Dear Friends, I have now retired from AT&T. New coordinates: Neil J. A. Sloane, President, OEIS Foundation 11 South Adelaide Avenue, Highland Park, NJ 08904, USA Phone: 732 828 6098; home page: http://NeilSloane.com Email: njasloane@gmail.com