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.

This page as a plain text file.
%I A329405 #55 May 26 2021 03:08:12
%S A329405 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,
%T A329405 26,28,29,34,31,32,33,30,35,39,37,38,40,36,41,44,43,42,45,46,47,48,51,
%U A329405 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
%N A329405 Among the pairwise sums of any three consecutive terms there is no prime: lexicographically earliest such sequence of distinct positive integers.
%C A329405 Conjectured to be a permutation of the positive integers.
%C A329405 From _M. F. Hasler_, Nov 14 2019: (Start)
%C A329405 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.
%C A329405 See A329450, A329452 onward and the wiki page for variants and further considerations about existence, surjectivity, etc. of such sequences. (End)
%H A329405 Jean-Marc Falcoz, <a href="/A329405/b329405.txt">Table of n, a(n) for n = 1..10000</a>
%H A329405 M. F. Hasler, <a href="/wiki/User:M._F._Hasler/Prime_sums_from_neighboring_terms">Prime sums from neighboring terms</a>, OEIS wiki, Nov. 23, 2019
%e A329405 a(1) = 1 from minimality.
%e A329405 a(2) = 3 since 2 would produce 3 (a prime) by making 1 + 2.
%e A329405 a(3) = 5 since 2 or 4 would produce a prime (e.g., 3 + 4 = 7).
%e A329405 a(4) = 7 since 2, 4 or 6 would produce a prime (e.g., 5 + 6 = 11).
%e A329405 ...
%e A329405 a(8) = 14 as 2, 4, 6, 8, 10 or 12 would produce a prime together with a(7) = 13 or a(6) = 11.
%e A329405 a(9) = 2 as neither 2 + 13 = 15 nor 2 + 14 = 16 is prime.
%e A329405 And so on.
%t A329405 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 *)
%o A329405 (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).
%Y A329405 Cf. A329333 (3 consecutive terms, exactly 1 prime sum).
%Y A329405 Cf. A329406 .. A329410 (exactly 1 prime sum using 4, ..., 10 consecutive terms).
%Y A329405 Cf. A329411 .. A329416 (exactly 2 prime sums using 3, ..., 10 consecutive terms).
%Y A329405 See also A329450, A329452 onwards for "nonnegative" variants.
%K A329405 nonn
%O A329405 1,2
%A A329405 _Eric Angelini_ and _Jean-Marc Falcoz_, Nov 13 2019
%E A329405 Edited by _N. J. A. Sloane_, Nov 15 2019