login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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

%I #14 Feb 09 2020 22:48:27

%S 0,1,2,3,6,24,4,5,8,9,10,11,7,13,12,17,16,14,15,19,22,18,21,20,26,23,

%T 25,27,33,34,28,29,32,38,39,30,31,41,40,36,35,42,61,44,43,66,37,52,45,

%U 47,46,51,50,57,48,49,53,55,56,59,54,58,72,95,62,65,67,63,84,64,60,68,89,71,69,73,80,78,70,79,87,76,75,74,88,77,81,82,189,85

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

%C That is, there are 5 primes, counted with multiplicity, among the 15 pairwise sums of any 6 consecutive terms.

%C Conjectured to be a permutation of the nonnegative integers.

%C If so, then the restriction to [1..oo) is a permutation of the positive integers.

%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

%e For n = 0, we consider pairwise sums of the first 6 terms a(0..5) = (0, 1, 2, 3, 6, 24): We have (a(i) + a(j), 0 <= i < j < 6) = (1; 2, 3; 3, 4, 5; 6, 7, 8, 9; 24, 25, 26, 27, 30) among which there are 5 primes, counted with repetition. If one tries to take a(4) equal to 4 or 5, this yields already 6 primes among the pairwise sums of the first 5 terms, so the smallest possible choice is a(4) = 6, and thereafter any a(5) less than 24 would again yield too many prime sums. So (0, 1, 2, 3, 6, 24) is indeed the start of the lexicographically earliest nonnegative sequence with the required properties.

%e Then one finds that a(6) = 4 is possible, giving also 6 prime sums for n = 1, so this is the correct continuation (modulo later confirmation that the sequence can be continued without contradiction given this choice).

%e Next one finds that a(7) = 5 is also possible, and so on.

%o (PARI) {A329565(n,show=0,o=0,N=5/*#primes*/,M=5,p=[],U,u=o)=for(n=o,n-1, if(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]))));if(#p<M&&sum(i=1,#p,isprime(p[i]+u))<=c,o=u)|| for(k=u,oo,bittest(U,k-u)|| sum(i=1,#p,isprime(p[i]+k))!=c||[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; o=1: start at a(1)=1; N, M: find N primes using M+1 terms. See the wiki page for a function S() which returns a vector: a(0..n-1) = S(n,5,6).

%Y Cf. A329425 (6 primes using 5 consecutive terms), A329566 (6 primes using 6 consecutive terms).

%Y Cf. A329449 (4 primes using 4 consecutive terms), A329456 (4 primes using 5 consecutive terms).

%Y Cf. A329454 (3 primes using 4 consecutive terms), A329455 (3 primes using 5 consecutive terms).

%Y Cf. A329411 (2 primes using 3 consecutive terms), A329452 (2 primes using 4 consecutive terms), A329453 (2 primes using 5 consecutive terms).

%Y Cf. A329333 (1 (odd) prime using 3 terms), A128280 & A055265 (1 prime using 2 terms); A055266 & A253074 (0 primes using 2 terms), A329405 & A329450 (0 primes using 3 terms), A329406 ff: other variants.

%K nonn

%O 0,3

%A _M. F. Hasler_, Feb 09 2020