OFFSET

1,2

COMMENTS

That is, there are 5 primes, counted with multiplicity, among the 10 pairwise sums of any 5 consecutive terms.

Conjectured to be a permutation of the positive integers.

This sequence is quite different from the restriction of the "nonnegative" variant A329564 to positive indices: it seems that the two have no common terms beyond a(6) = 8, except for the accidental a(22) = 15 and maybe some later coincidences of this type. There also appears to be no other simple relation between the terms of these sequences, in contrast to, e.g., A055265 vs. A128280.

LINKS

M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019

EXAMPLE

For n = 1, we consider pairwise sums among the first 5 terms chosen as small as possible, a(1..5) = (1, 2, 3, 4, 5). We see that we have indeed 5 primes among the sums 1+2, 1+3, 1+4, 1+5, 2+3, 2+4, 2+5, 3+4, 3+5, 4+5.

Then, to get a(6), consider first the pairwise sums among terms a(2..5), (2+3, 2+4, 2+5; 3+4, 3+5; 4+5), among which there are 3 primes, counted with multiplicity (i.e., the prime 7 is there two times). So the new term a(6) must give exactly two more prime sums with the terms a(2..5). We find that 6 or 7 would give just one more (5+6 resp. 4+7), but a(6) = 8 gives exactly two more, 3+8 and 5+8.

PROG

(PARI) {A329563(n, show=1, o=1, N=5, M=4, p=[], u=o, U)=for(n=o, n-1, 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. See the wiki page for a function S() which returns a vector: a(0..n-1) = S(5, 5; 1).

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