OFFSET
1,3
COMMENTS
Because all terms of Sylvester's sequence are coprime to each other, each prime in A007996 divides only one term of A000058. The Mathematica program computes both the primes in A007996 and the terms in this sequence. Using modular arithmetic, it is easy to see that if prime p divides A000058(k) for some k, then we must have k < p. In practice, k < 5*sqrt(p).
LINKS
Max Alekseyev, Table of n, a(n) for n = 1..12046 (first 8181 terms are also given at the Andersen link)
Jens Kruse Andersen, Factorization of Sylvester's sequence
FORMULA
EXAMPLE
A000058(4) = 1807 = 43 * 181 = A007996(4) * A007996(7), so a(4) = a(7) = 4. - Jonathan Sondow, Jan 26 2014
MATHEMATICA
t={}; p=1; While[Length[t]<100, p=NextPrime[p]; s=Mod[2, p]; k=0; modSet={}; While[s>0 && !MemberQ[modSet, s], AppendTo[modSet, s]; k++; s=Mod[s^2-s+1, p]]; If[s==0, AppendTo[t, {p, k}]]]; Transpose[t][[2]]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Sep 25 2010
EXTENSIONS
Definition clarified by Jonathan Sondow, Jan 26 2014
STATUS
approved