OFFSET
0,3
COMMENTS
That is, there are 5 primes, counted with multiplicity, among the 15 pairwise sums of any 6 consecutive terms.
Conjectured to be a permutation of the nonnegative integers.
If so, then the restriction to [1..oo) is a permutation of the positive integers.
LINKS
M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
EXAMPLE
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.
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).
Next one finds that a(7) = 5 is also possible, and so on.
PROG
(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).
CROSSREFS
Cf. A329411 (2 primes using 3 consecutive terms), A329452 (2 primes using 4 consecutive terms), A329453 (2 primes using 5 consecutive terms).
KEYWORD
nonn
AUTHOR
M. F. Hasler, Feb 09 2020
STATUS
approved