cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A329450 Lexicographically earliest sequence of distinct nonnegative integers such that neither a(n) + a(n+1) nor a(n) + a(n+2) is prime for any n.

Original entry on oeis.org

0, 1, 8, 7, 2, 13, 12, 3, 6, 9, 15, 5, 10, 4, 11, 14, 16, 18, 17, 21, 19, 23, 25, 26, 20, 22, 24, 27, 28, 29, 34, 31, 32, 33, 30, 35, 39, 37, 38, 40, 36, 41, 44, 43, 42, 45, 46, 47, 48, 51, 54, 57, 58, 53, 52, 59, 56, 49, 50, 55, 60, 61, 62, 63, 66, 67, 68, 65, 64, 69, 71, 72, 70, 73, 74, 79, 76
Offset: 0

Views

Author

M. F. Hasler, based on an idea of Eric Angelini, Nov 13 2019

Keywords

Comments

Equivalently: For any three consecutive terms, there is no prime among any of the pairwise sums. Or: For any n and 0 <= i < j <= 2, a(n+i) + a(n+j) is never prime.
For any n, a term a(n) which meets the requirements always exists: For any a(n-2), a(n-1), at least one in five consecutive values of k is such that one among {a(n-2) + k, a(n-1) + k} is divisible by 2 and the other one by 3.
Conjectured to be a permutation of the nonnegative integers. The restriction to positive indices is then a permutation of the positive integers with the same property, but not the lexicographically earliest given in A329405.
See the wiki page for additional considerations and other variants. - M. F. Hasler, Nov 24 2019

Examples

			After the smallest possible initial terms, a(0) = 0, a(1) = 1, the next term must be neither a prime nor a prime - 1. The smallest possibility is a(2) = 8.
The next term must not be a prime - 1 nor a prime - 8, which excludes 2, 4, 6 on one hand, and 3 and 5 on the other hand. The smallest possibility is a(3) = 7.
		

Crossrefs

Cf. A329333 (always one odd prime among a(n+i)+a(n+j), 0 <= i < j <= 2).
Cf. A329405 (analog for positive integers).

Programs

  • Mathematica
    Nest[Block[{k = 2}, While[Nand[FreeQ[#, k], ! PrimeQ[#[[-1]] + k], ! PrimeQ[#[[-2]] + k]], k++]; Append[#, k]] &, {0, 1}, 89] (* Michael De Vlieger, Nov 15 2019 *)
  • PARI
    A329450(n,show=0,o=0,p=o,U=[])={for(n=o,n-1, show&&print1(p","); U=setunion(U,[p]); while(#U>1&&U[1]==U[2]-1, U=U[^1]); for(k=U[1]+1,oo, setsearch(U,k) || isprime(o+k) || isprime(p+k) || [o=p, p=k, break]));p} \\ Optional args: show=1: print a(o..n-1); o=1: start with a(1) = 1 (A329405). See the wiki page for more general code returning a vector: S(n,0,3) = A329450(0..n-1).

Extensions

Edited by N. J. A. Sloane, Nov 14 2019
New definition corrected by M. F. Hasler, Nov 15 2019