

A329574


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


2



0, 1, 2, 3, 4, 5, 8, 9, 10, 14, 33, 15, 20, 27, 26, 11, 32, 16, 41, 21, 57, 116, 22, 51, 38, 23, 50, 63, 86, 6, 17, 24, 77, 65, 18, 13, 114, 25, 36, 28, 35, 43, 12, 31, 61, 66, 40, 19, 47, 42, 90, 241, 7, 52, 37, 34, 45, 30, 55, 49, 394, 58, 73, 39, 48, 64, 109, 115
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,3


COMMENTS

That is, there are 10 primes, counted with multiplicity, among the 21 pairwise sums of any 7 consecutive terms.
Conjectured to be a permutation of the nonnegative integers.
If it is, then the restriction to [1..oo) is a permutation of the positive integers, but maybe not the lexicographically earliest one with this property.
This is the first example of a sequence of this type for which the greedy choice of a(n) is frequently incorrect beyond the initial terms, see Examples.


LINKS

Table of n, a(n) for n=0..67.
M. F. Hasler, Prime sums from neighboring terms, OEIS Wiki, Nov. 23, 2019, updated Feb. 2020.


EXAMPLE

At the beginning of the sequence, we must avoid the choice of 6 or 7 for a(6): both appear to be possible at first sight, giving exactly 10 prime sums with n = 0 in the definition, but then make it impossible to find a successor term a(7) for which the definition is satisfied with n = 1.
The same happens again for a(37) and a(58), where the apparently possible value 19 resp. 46 must be avoided.


PROG

(PARI) {A329574(n, show=0, o=0, N=10, M=6, X=[[6, 6], [6, 7], [37, 19], [58, 46]], p=[], u=o, U)=for(n=o+1, n, show>0&& print1(o", "); show<0&& listput(L, o); U+=1<<(ou); U>>=u+u+=valuation(U+1, 2); p=concat(if(#p>=M, p[^1], p), o); my(c=Nsum(i=2, #p, sum(j=1, i1, isprime(p[i]+p[j])))); for(k=u, oo, bittest(U, ku) min(c#[0x<p, isprime(x+k)], #p>=M) setsearch(X, [n, k]) [o=k, break])); show&&print([u]); o} \\ optional args: show=1: print a(o..n1), show=1: append them on global list L, in both cases print [least unused number] at the end. Parameters N, M, o, ... allow to get other variants, see the wiki page for more.


CROSSREFS

Cf. A055265, A128280 (1 prime from 2 terms), A329333 (1 prime from 3 terms), A329405, ..., A329416 (N primes from M terms >= 1), A329425, A329449, ..., A329581 (N primes from M terms >= 0).
Sequence in context: A094566 A190018 A217349 * A087278 A054219 A337801
Adjacent sequences: A329571 A329572 A329573 * A329575 A329576 A329577


KEYWORD

nonn


AUTHOR

M. F. Hasler, Feb 10 2020


STATUS

approved



