OFFSET
1,2
COMMENTS
That is, there are 7 primes, counted with multiplicity, among the 15 pairwise sums of any 6 consecutive terms.
Conjectured to be a permutation of the positive integers.
LINKS
M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
EXAMPLE
For n = 1, we must forbid the greedy choice for a(6) which would be 6, which leads to a dead end: there is no possibility to find a subsequent term that would give 7 prime sums together with {2, 3, 4, 5, 6}. If we take the next larger possibility, a(6) = 8, then it works for the next and all subsequent terms.
PROG
(PARI) {A329576(n, show=1, o=1, N=7, M=5, X=[[6, 6]], 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])))); 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|| 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. See the wiki page for more.
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