OFFSET
1,2
COMMENTS
I have checked out to the first 250000 primes but the last entry is at the 504th prime, 3607.
EXAMPLE
128 is a term because 128 = -1 + Sum_{i=1..10} prime(i) = 2^7.
MAPLE
with(numtheory); egcd := proc(n) local L; L:=map(proc(z) z[2] end, ifactors(n)[2]); igcd(op(L)) end: s := proc(n) option remember; local p; if n=1 then [1, 2] else p:=ithprime(n); [n, s(n-1)[2]+p] fi end; t := proc(n) option remember; [n, s(n)[2]-1] end; PW:=[]; for z to 1 do for j from 1 to 250000 do if egcd(t(j)[2])>1 or t(j)[2]=1 then PW:=[op(PW), t(j)] fi od od; PW;
MATHEMATICA
s = 0; Do[s = s + Prime[n]; If[s == 2 || GCD @@ Transpose[ FactorInteger[s - 1]][[2]] > 1, Print[s - 1]], {n, 10^6}] (* Robert G. Wilson v, Oct 02 2005 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Walter Kehowski, Sep 30 2005
EXTENSIONS
Initial 1 and a(9) added by Jinyuan Wang, Aug 10 2023
STATUS
approved