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.
%I A329412 #28 Jan 26 2024 05:09:06 %S A329412 1,2,3,7,5,4,8,6,9,10,11,12,13,16,15,17,20,21,18,19,23,26,24,14,27,32, %T A329412 22,25,28,29,30,33,31,34,36,35,38,39,40,41,42,37,43,47,46,50,53,44,49, %U A329412 45,48,54,55,51,56,57,59,52,61,66,58,65,62,72,60,67,63,68,69,73,64,70,75,74,76,71,105 %N A329412 Lexicographically earliest sequence of distinct positive numbers such that among the pairwise sums of any four consecutive terms there are exactly two prime sums. %C A329412 Conjectured to be a permutation of the positive integers: a(10^5) = 10^5, a(10^6) = 999984 and all numbers below 99992 resp. 999963 have appeared by then. See A329452 for a more detailed discussion. - _M. F. Hasler_, Nov 15 2019 %H A329412 Jean-Marc Falcoz, <a href="/A329412/b329412.txt">Table of n, a(n) for n = 1..10000</a> %e A329412 a(1) = 1 is the smallest possible choice; there are no other restrictions so far. %e A329412 a(2) = 2 as 2 is the smallest available integer not leading to a contradiction. Note that as 1 + 2 = 3 we already have one prime sum (of the required two) with the quadruplet {1, 2, a(3), a(4)}. %e A329412 a(3) = 3 as 3 is the smallest available integer not leading to a contradiction. Note that as 2 + 3 = 5 we now have the two prime sums required with the quadruplet {1,2,5,a(4)}. %e A329412 a(4) = 7 as a(4) = 4, 5 or 6 would lead to a contradiction: indeed, both the quadruplets {1, 2, 3, 4}, {1, 2, 3, 5} and {1, 2, 3, 6} will produce three prime sums (instead of two). With a(4) = 7 we have the quadruplet {1, 2, 3, 7} and the two prime sums we are looking for: 1 + 2 = 3 and 2 + 3 = 5. %e A329412 a(5) = 5 as a(5) = 4 would again lead to a contradiction: indeed, the quadruplet {2, 3, 7, 4} will produce three prime sums (instead of two, they would be 2 + 3 = 5; 3 + 4 = 7 and 7 + 4 = 11). With a(5) = 5 the quadruplet {2, 3, 7, 4} shows exactly the two prime sums we are looking for: 2 + 3 = 5 and 3 + 4 = 7. %e A329412 And so on. %o A329412 (PARI) A329412(n,show=0,o=1,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]));o} \\ Optional args: show=1: print a(o..n-1); o=0: start with a(0)=0 (A329452). - _M. F. Hasler_, Nov 15 2019 %Y A329412 Cf. A329333 (3 consecutive terms, exactly 1 prime sum). %Y A329412 Cf. A329452 (variant using nonnegative integers). %K A329412 nonn %O A329412 1,2 %A A329412 _Eric Angelini_ and _Jean-Marc Falcoz_, Nov 14 2019