OFFSET
0,3
COMMENTS
That is, there are 7 primes, counted with multiplicity, among the 21 pairwise sums of any 7 consecutive terms.
Is this a permutation of the nonnegative integers?
If so, then the restriction to [1..oo) is a permutation of the positive integers, but not the lexicographically earliest one with this property, which starts (1, 2, 3, 4, 5, 6, 89, 8, 7, 9, 10, 11, 14, 12, 17, 19, 18, 13, ...).
PROG
(PARI) A329577(n, show=0, o=0, N=7, M=6, 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
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Nov 17 2019
STATUS
approved