A078425 Primes in "Ulam's Prime sequence". A prime is in the sequence iff p+1 can be expressed in exactly 1 way as the sum of 2 previous distinct primes.
3, 5, 7, 11, 13, 19, 29, 41, 43, 59, 83, 89, 107, 109, 127, 139, 157, 163, 173, 199, 211, 223, 257, 271, 277, 293, 307, 331, 347, 367, 397, 421, 443, 457, 491, 541, 557, 587, 601, 631, 691, 761, 769, 821, 911, 941, 971, 991, 1009, 1033, 1103, 1129, 1153, 1201
Offset: 1
Keywords
Examples
a(3)=7 as 8=3+5. a(4)=11 as 12=5+7 (and nothing else).
Links
Programs
-
PARI
v=vector(1220);vc=2;v[1]=3;v[2]=5; forprime (p=7,1220,p1=p+1;pc=0;fl=0;for (i=1,vc-1, for (j=i+1,vc,if (v[i]+v[j]==p1,pc++);if (pc>1,fl=1);if (fl,break));if (fl,break));if (pc==0,fl=1);if (!fl,vc++;v[vc]=p));print(vecextract(v,concat("1..",vc)))
Extensions
Edited and extended by Klaus Brockhaus, Apr 14 2005
Comments