A329568 For all n >= 1, exactly 9 sums are prime among a(n+i) + a(n+j), 0 <= i < j < 6: lexicographically earliest such sequence of distinct positive numbers.
1, 2, 3, 9, 4, 10, 27, 14, 33, 57, 26, 40, 87, 50, 21, 63, 16, 20, 51, 8, 81, 93, 46, 56, 15, 58, 135, 183, 28, 44, 39, 88, 69, 123, 34, 68, 105, 128, 45, 129, 22, 52, 141, 38, 75, 159, 32, 82, 99, 64, 117, 147, 80, 94, 177, 116, 237, 273, 74, 100, 387, 76, 207, 357, 62, 104, 165, 86, 77, 95
Offset: 1
Keywords
Links
- Éric Angelini, Prime sums from neighbouring terms, SeqFan list, Nov 11 2019.
- M. F. Hasler, Prime sums from neighboring terms, OEIS Wiki, Nov 23 2019.
Crossrefs
Programs
-
PARI
{A329568(n,show=0,o=1,N=9,M=5,X=[[4,x]|x<-[4..8]],p=[],u=o,U)=for(n=o+1,n, show>0&& print1(o","); show<0&& listput(L,o); U+=1<<(o-u); U>>=-u+u+=valuation(U+1,2); p=concat(if(#p>=M,p[^1],p),o); my(c=N-sum(i=2,#p, sum(j=1,i-1, isprime(p[i]+p[j])))); for(k=u,oo,bittest(U,k-u)|| min(c-#[0|x<-p,isprime(x+k)],#p>=M)|| setsearch(X,[n,k])|| [o=k,break])); show&&print([u]);o} \\ optional args: show=1: print a(o..n-1), show=-1: append them on global list L, in both cases print [least unused number] at the end. Parameters N,M,o,... allow getting other variants, see the wiki page for more.
Comments