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