login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A329564
For all n >= 0, exactly five sums are prime among a(n+i) + a(n+j), 0 <= i < j < 5; lexicographically earliest such sequence of distinct nonnegative numbers.
2
0, 1, 2, 3, 6, 5, 8, 11, 7, 12, 29, 18, 19, 4, 13, 9, 22, 10, 21, 14, 57, 16, 15, 17, 26, 27, 20, 23, 33, 34, 38, 45, 25, 28, 51, 46, 31, 43, 58, 30, 24, 37, 49, 35, 36, 102, 47, 42, 55, 32, 41, 48, 65, 39, 62, 44, 40, 63, 69, 50, 68, 59, 80, 71, 54, 77, 60, 53, 56, 74, 75
OFFSET
0,3
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 nonnegative integers.
If so, then the restriction to [1..oo) is a permutation of the positive integers, but not the smallest such, which is given in A329563. It seems that the two sequences 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. - M. F. Hasler, Feb 12 2020
LINKS
M. F. Hasler, Prime sums from neighboring terms, OEIS wiki, Nov. 23, 2019
EXAMPLE
For n = 0, we consider pairwise sums among the first 5 terms a(0..4), among which we must have 5 primes. To get a(4), consider first a(0..3) = (0, 1, 2, 3) and the pairwise sums (a(i) + a(j), 0 <= i < j <= 3) = (1; 2, 3; 3, 4, 5) among which there are 4 primes, counted with multiplicity (i.e., the prime 3 is there two times). So the additional term a(4) must give exactly one more prime sum with all of a(0..3). We find that 4 or 5 would give two more primes, but a(4) = 6 gives exactly one more, 1 + 6 = 7.
Now, for n = 1 we forget the initial 0 and consider the pairwise sums of the remaining terms {1, 2, 3, 6}. There are 3 prime sums, so the next term must give two more. The term 4 would give two more (1+4 and 3+4) primes, but thereafter we would have {2, 3, 6, 4} with only 2 prime sums and impossibility to add one term to get three more prime sums: 2+x, 6+x and 4+x can't be all prime for x > 1.
Therefore 4 isn't the next term, and we try a(5) = 5 which indeed gives the required number of primes, and also allows us to continue.
PROG
(PARI) {A329564(n, show=1, o=0, N=5, M=4, X=[[4, 4]], p=[], u, 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|| 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 a function S() which returns a vector: a(0..n-1) = S(5, 5; 0).
CROSSREFS
Cf. A329425 (6 primes using 5 consecutive terms).
Cf. A055266 & A253074 (0 primes using 2 terms), A329405 & A329450 (0 primes using 3 terms), A055265 & A128280 (1 prime using 2 terms), A329333, A329406 - A329410 (1 prime using 3, ..., 10 terms), A329411 - A329416 and A329452, A329453 (2 primes using 3, ..., 10 terms), A329454 & A329455 (3 primes using 4 resp. 5 terms), A329449 & A329456 (4 primes using 4 resp. 5 terms), A329568 & A329569 (9 primes using 6 terms), A329572 & A329573 (12 primes using 7 terms), A329563 - A329581: other variants.
Sequence in context: A344403 A326136 A276081 * A257011 A144652 A035493
KEYWORD
nonn
AUTHOR
M. F. Hasler, Feb 09 2020
STATUS
approved