A329452 There are exactly two primes in {a(n+i) + a(n+j), 0 <= i < j <= 3} for any n: lexicographically earliest such sequence of distinct nonnegative integers.
0, 1, 2, 8, 4, 5, 6, 3, 7, 11, 10, 9, 12, 13, 28, 15, 17, 16, 20, 14, 21, 22, 19, 23, 25, 24, 29, 30, 26, 18, 35, 31, 32, 27, 34, 36, 33, 38, 37, 40, 63, 39, 41, 44, 42, 45, 47, 50, 51, 43, 52, 49, 46, 48, 53, 54, 57, 55, 56, 58, 69, 62, 59, 65, 66, 61, 60, 67, 64, 68, 70, 81, 72, 76, 73, 75, 71
Offset: 0
Keywords
Examples
We start with a(0) = 0, a(1) = 1, a(2) = 2, the smallest possibilities which do not lead to a contradiction. Now there are already 2 primes, 0 + 2 and 1 + 2, among the pairwise sums, so the next term must not generate any further prime. Given 0 and 1, primes and (primes - 1) are excluded, and a(3) = 8 is the smallest possible choice. Now there is only one prime, 1 + 2 = 3, among the pairwise sums using {1, 2, 8}; the next term must produce exactly one additional prime as sum with these. We see that 3 is not possible (2 + 3 = 5 and 8 + 3 = 11), but a(4) = 4 is possible. Now using {2, 8, 4} we have no prime as a pairwise sum, so the next term must produce two primes among the sums with these terms. Again, 3 would give three primes, but 5 yields exactly two primes, 2 + 5 = 7 and 8 + 5 = 13.
Links
- Eric Angelini, Prime sums from neighbouring terms, personal blog "Cinquante signes" (and post to the SeqFan list), Nov. 11, 2019.
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of html file, with permission]
- Eric Angelini, Prime sums from neighbouring terms [Cached copy of pdf file, with permission]
- M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
Crossrefs
Programs
-
PARI
A329452(n,show=0,o=0,p=[],U,u=o)={for(n=o,n-1, show&&print1(o","); U+=1<<(o-u); U>>=-u+u+=valuation(U+1,2); p=concat(if(2<#p,p[^1],p),o); my(c=2-sum(i=2,#p,sum(j=1,i-1,isprime(p[i]+p[j])))); if(#p<3, o=u;next); for(k=u,oo, bittest(U,k-u) || sum(i=1,#p,isprime(p[i]+k))!=c || [o=k, break]));print([u]);o} \\ Optional args: show=1: print a(o..n-1); o=1: use indices & terms >= 1, i.e., compute A329412. See the wiki page for more general code returning a vector: S(n,2,4) = a(0..n-1).
Extensions
Edited (deleted comments now found on the wiki) by M. F. Hasler, Nov 24 2019
Comments