[seqfan] Re: A057652 has no more terms below 10^4

T. D. Noe noe at sspectra.com
Wed Oct 20 20:03:39 CEST 2010


I tend to agree with the conjecture that there are no additional terms.
However, it's always fun to look.

Using Mathematica, it takes only about an hour to verify that there are no
additional terms less than 10^7. Here is the code to create the lucky
numbers (modified from Robert Wilson's code):

nn=10^7;
lucky=Range[1,nn,2];
sieve[n_Integer]:=Module[{k=lucky[[n]]},
lucky=Delete[lucky,Table[{i},{i,k,Length[lucky],k}]]];
n=1; While[lucky[[n]] < Length[lucky], n++; sieve[n]]

Using the BinarySearch function in the Combinatoria package, the following
function quickly determines whether n is lucky:

LuckyQ[n_Integer] := IntegerQ[BinarySearch[lucky,n]]

This tests n up to 10^7:

Do[k=2; While[k<n && LuckyQ[n-k], k=2k]; If[k=>n, Print[n]], {n,nn}]

Best regards,

Tony




More information about the SeqFan mailing list