login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A329572 For all n >= 0, exactly 12 sums are prime among a(n+i) + a(n+j), 0 <= i < j < 7; lexicographically earliest such sequence of distinct nonnegative numbers. 3

%I #12 Feb 19 2020 04:07:22

%S 0,1,2,5,6,11,12,17,26,35,36,47,24,54,77,7,43,60,13,30,96,4,67,97,16,

%T 133,34,3,40,27,63,100,10,20,171,9,8,51,21,22,52,15,32,38,75,141,56,

%U 41,71,122,152,45,68,29,59,14,39,44,50,23,53,57,74,107,170,176,93,134,137,86,177,65,476,62,87,92,101

%N For all n >= 0, exactly 12 sums are prime among a(n+i) + a(n+j), 0 <= i < j < 7; lexicographically earliest such sequence of distinct nonnegative numbers.

%C That is, there are 12 primes, counted with multiplicity, among the 21 pairwise sums of any 7 consecutive terms.

%C This is the theoretical maximum: there can't be more than 12 primes in pairwise sums of 7 distinct numbers > 1. See the wiki page for more details.

%C Conjectured to be a permutation of the nonnegative integers. See A329573 for the "positive" variant: same definition but with offset 1 and positive terms, leading to a quite different sequence.

%C For a(3) and a(4) resp. a(5) one must forbid the values < 5 resp. < 11 which would be the greedy choices, in order to get a solution for a(7), but from then on, the greedy choice gives the correct solution, at least for several hundred terms.

%H M. F. Hasler, <a href="/wiki/User:M._F._Hasler/Prime_sums_from_neighboring_terms">Prime sums from neighboring terms</a>, OEIS wiki, Nov. 23, 2019

%o (PARI) {A329572(n,show=0,o=0,N=12,M=6,D=[3,5,4,6,5,11],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); D&& D[1]==n&& [o=D[2],D=D[3..-1]]&& next; 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|p<-p,isprime(p+k)],#p>=M)|| [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. See the wiki page for more.

%Y Cf. A055273 (analog starting with a(1) = 1), A055265 & A128280 (1 prime using 2 terms), A055266 & A253074 (0 primes using 2 terms), A329405 - A329416, A329425, A329333, A329449 - A329456, A329563 - A329581.

%K nonn

%O 0,3

%A _M. F. Hasler_, Feb 09 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 1 03:10 EDT 2024. Contains 374810 sequences. (Running on oeis4.)