A060341 Non-adding primes: next term is smallest prime not the sum of any primes so far.
2, 3, 7, 11, 17, 41, 47, 83, 89, 307, 311, 613, 617, 919, 2801, 3109, 3413, 9283, 15461, 25087, 37781, 87613, 106181, 284509, 296591, 618269, 1196609, 1774921, 3564677, 5339287, 9818789, 14295223, 23196731, 46393469, 93691861, 98171363, 190948399, 429204473
Offset: 1
Keywords
Examples
5 is not included because 2 + 3 = 5. Given 2, 3, 7 we can get 5 but not 11, so term after 7 is 11. 13 is not included because 2 + 11 = 13.
Links
- Jinyuan Wang, Table of n, a(n) for n = 1..1000
- Carlos Rivera, Puzzle 127. Non adding prime sequences, The Prime Puzzles & Problems Connection.
Programs
-
PARI
lista(nn) = my(p=2, i, j, s, t, u, v=[2, 1], w); print1(p); for(n=2, nn, u=0; i=1; j=1; w=List([]); s=0; t=1; while(i<=#v, if(j>#v, if(i%2==t, s+=v[i], t=!t; listput(w, s); s=v[i]); i++, if(v[i]>u, if((i%2&&j%2)==t, s+=u, t=!t; listput(w, s); s=u); v[i]-=u; if(j++<=#v, u=v[j]), if((i%2&&j%2)==t, s+=v[i], t=!t; listput(w, s); s=v[i]); if(v[i]==u, if(j++<=#v, u=v[j]), u-=v[i]); i++))); listput(w, s); v=w; s=0; i=0; until(isprime(p), p++; while(s<=p&&i<#v, s+=v[i++]); if(s>p&&!(i%2), p=s)); print1(", ", v[1]=p)); \\ Jinyuan Wang, Dec 17 2024
Extensions
a(37)-a(53) from Jacques Tramu, Jan 11 2005
Offset changed to 1 by Jinyuan Wang, Dec 17 2024
Comments