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.

A329452 There are exactly two primes in {a(n+i) + a(n+j), 0 <= i < j <= 3} for any n: lexicographically earliest such sequence of distinct nonnegative integers.

This page as a plain text file.
%I A329452 #25 Dec 21 2024 11:58:31
%S A329452 0,1,2,8,4,5,6,3,7,11,10,9,12,13,28,15,17,16,20,14,21,22,19,23,25,24,
%T A329452 29,30,26,18,35,31,32,27,34,36,33,38,37,40,63,39,41,44,42,45,47,50,51,
%U A329452 43,52,49,46,48,53,54,57,55,56,58,69,62,59,65,66,61,60,67,64,68,70,81,72,76,73,75,71
%N A329452 There are exactly two primes in {a(n+i) + a(n+j), 0 <= i < j <= 3} for any n: lexicographically earliest such sequence of distinct nonnegative integers.
%C A329452 That is, there are exactly two primes among the 6 pairwise sums of any four consecutive terms.
%C A329452 Conjectured to be a permutation of the nonnegative numbers.
%C A329452 a(100) = 97, a(1000) = 1001, a(10^4) = 9997, a(10^5) = 10^5, a(10^6) = 999984 and all numbers below 999963 have appeared at that point.
%C A329452 See the wiki page for considerations about existence and surjectivity of the sequence and variants thereof.
%H A329452 Eric Angelini, <a href="http://cinquantesignes.blogspot.com/2019/11/prime-sums-from-neighbouring-terms.html">Prime sums from neighbouring terms</a>, personal blog "Cinquante signes" (and post to the SeqFan list), Nov. 11, 2019.
%H A329452 Eric Angelini, <a href="/A329333/a329333.htm">Prime sums from neighbouring terms</a> [Cached copy of html file, with permission]
%H A329452 Eric Angelini, <a href="/A329333/a329333.pdf">Prime sums from neighbouring terms</a> [Cached copy of pdf file, with permission]
%H A329452 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 A329452 We start with a(0) = 0, a(1) = 1, a(2) = 2, the smallest possibilities which do not lead to a contradiction.
%e A329452 Now there are already 2 primes, 0 + 2 and 1 + 2, among the pairwise sums, so the next term must not generate any further prime. Given 0 and 1, primes and (primes - 1) are excluded, and a(3) = 8 is the smallest possible choice.
%e A329452 Now there is only one prime, 1 + 2 = 3, among the pairwise sums using {1, 2, 8}; the next term must produce exactly one additional prime as sum with these. We see that 3 is not possible (2 + 3 = 5 and 8 + 3 = 11), but a(4) = 4 is possible.
%e A329452 Now using {2, 8, 4} we have no prime as a pairwise sum, so the next term must produce two primes among the sums with these terms. Again, 3 would give three primes, but 5 yields exactly two primes, 2 + 5 = 7 and 8 + 5 = 13.
%o A329452 (PARI) A329452(n,show=0,o=0,p=[],U,u=o)={for(n=o,n-1, show&&print1(o","); U+=1<<(o-u); U>>=-u+u+=valuation(U+1,2); p=concat(if(2<#p,p[^1],p),o); my(c=2-sum(i=2,#p,sum(j=1,i-1,isprime(p[i]+p[j])))); if(#p<3, o=u;next); for(k=u,oo, bittest(U,k-u) || sum(i=1,#p,isprime(p[i]+k))!=c || [o=k, break]));print([u]);o} \\ Optional args: show=1: print a(o..n-1); o=1: use indices & terms >= 1, i.e., compute A329412. See the wiki page for more general code returning a vector: S(n,2,4) = a(0..n-1).
%Y A329452 Cf. A329412 (analog for positive integers), A329453 (2 primes in a(n+i)+a(n+j), i < j < 5).
%Y A329452 Cf. A329333 (one odd prime among a(n+i)+a(n+j), 0 <= i < j < 3), A329450 (no prime in a(n+i)+a(n+j), i < j < 3).
%K A329452 nonn
%O A329452 0,3
%A A329452 _M. F. Hasler_, Nov 15 2019
%E A329452 Edited (deleted comments now found on the wiki) by _M. F. Hasler_, Nov 24 2019