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.

A329405 Among the pairwise sums of any three consecutive terms there is no prime: lexicographically earliest such sequence of distinct positive integers.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 14, 2, 4, 6, 8, 10, 12, 15, 18, 17, 16, 19, 20, 25, 24, 21, 27, 23, 22, 26, 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, 77, 78
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Nov 13 2019

Keywords

Comments

Conjectured to be a permutation of the positive integers.
From M. F. Hasler, Nov 14 2019: (Start)
Equivalently: For any n, neither a(n) + a(n+1) nor a(n) + a(n+2) is prime. Or: For any n and 0 <= i < j <= 2, a(n+i) + a(n+j) is never prime.
See A329450, A329452 onward and the wiki page for variants and further considerations about existence, surjectivity, etc. of such sequences. (End)

Examples

			a(1) = 1 from minimality.
a(2) = 3 since 2 would produce 3 (a prime) by making 1 + 2.
a(3) = 5 since 2 or 4 would produce a prime (e.g., 3 + 4 = 7).
a(4) = 7 since 2, 4 or 6 would produce a prime (e.g., 5 + 6 = 11).
...
a(8) = 14 as 2, 4, 6, 8, 10 or 12 would produce a prime together with a(7) = 13 or a(6) = 11.
a(9) = 2 as neither 2 + 13 = 15 nor 2 + 14 = 16 is prime.
And so on.
		

Crossrefs

Cf. A329333 (3 consecutive terms, exactly 1 prime sum).
Cf. A329406 .. A329410 (exactly 1 prime sum using 4, ..., 10 consecutive terms).
Cf. A329411 .. A329416 (exactly 2 prime sums using 3, ..., 10 consecutive terms).
See also A329450, A329452 onwards for "nonnegative" variants.

Programs

  • Mathematica
    a[1]=1;a[2]=3;a[n_]:=a[n]=(k=1;While[Or@@PrimeQ[Plus@@@Subsets[{a[n-1],a[n-2],++k},{2}]]||MemberQ[Array[a,n-1],k]];k);Array[a,100] (* Giorgos Kalogeropoulos, May 09 2021 *)
  • PARI
    A329405(n, show=1, o=1, 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=0: don't print the list; o=0: start with a(0) = 0, i.e., compute A329450. See the wiki page for more general code returning a vector: S(n,0,3,1) = a(1..n).

Extensions

Edited by N. J. A. Sloane, Nov 15 2019