OFFSET
1,3
COMMENTS
a(n) = 1 if and only if n is in A006093 (primes minus 1), so 1 occurs infinitely often.
EXAMPLE
Consider n = 7. 1 + Sum{j=1...7} k^(2*j-1) evaluates to 8, 10923, 1793614, 71582789, 1271565756, 13433856703, 98907531458, 558482096649, 2573639151184, 10101010101011 for k = 1, ..., 10. Only the last of these numbers, 1+10+10^3+10^5+10^7+10^9+10^11+10^13 = 10101010101011, is prime, hence a(7) = 10.
MATHEMATICA
f[n_] := Block[{k = 1}, While[ !PrimeQ[Sum[k^(2j - 1), {j, n}] + 1], k++ ]; k]; Array[f, 74] (* Robert G. Wilson v, Dec 17 2006 *)
PROG
(PARI) a(n)={my(k=1); while(!isprime(1+sum(j=1, n, k^(2*j-1))), k++); k} \\ Klaus Brockhaus, Dec 16 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Dec 13 2006, Dec 14 2006
EXTENSIONS
Edited and extended by Klaus Brockhaus, Dec 16 2006
STATUS
approved