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 A354370 #23 Jun 25 2022 22:03:11 %S A354370 2,3,5,6,7,4,11,8,13,10,17,12,19,18,23,14,29,24,31,16,37,22,41,20,43, %T A354370 28,47,26,53,30,59,38,61,36,67,34,71,32,73,40,79,48,83,44,89,42,97,52, %U A354370 101,50,103,46,107,56,109,54,113,60,127,64,131,62,137,74,139,58,149,78,151,72,157,66,163,70 %N A354370 Successive pairs of terms (i, j) such that (i + j) is a prime number and at least i is a prime number. This is the lexicographically earliest infinite sequence of distinct terms > 1 with this property. %C A354370 The terms 1, 9, 15, 21, 25, 27, 33, 35, 39, 45, ... will never appear in the sequence; they form A014076, the "Odd nonprimes". Two prime terms can form a pair (2 and 3 for instance) but the first term must always be a prime [the pair (5, 6) is ok]. %H A354370 Michael De Vlieger, <a href="/A354370/a354370.png">Annotated log-log scatterplot of a(n)</a>, n = 1..10^4, showing records in red and local minima in blue, highlighting fixed points in gold and composite powers of 2 in magenta. %e A354370 The earliest pairs with their prime sum: (2, 3) = 5, (5, 6) = 11, (7, 4) = 11, (11, 8) = 19, (13, 10) = 23, (17, 12) = 29, (19, 18) = 37, (23, 14) = 37, etc. %t A354370 nn = 120; c[_] = 0; a[1] = 2; c[2] = 1; u = 3; Do[If[EvenQ[i], k = u; While[Nand[c[k] == 0, PrimeQ[# + k]] &[a[i - 1]], k++], k = u; While[Nand[c[k] == 0, PrimeQ[k]], k++]]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[Or[c[u] > 0, And[OddQ[u], CompositeQ[u]]], u++]], {i, 2, nn}]; Array[a, nn] (* _Michael De Vlieger_, May 24 2022 *) %o A354370 (Python) %o A354370 from sympy import isprime %o A354370 from itertools import islice %o A354370 def agen(): # generator of terms %o A354370 i, j, v, aset = 2, 3, 4, set() %o A354370 while True: %o A354370 aset.update((i, j)); yield from (i, j) %o A354370 i = j = v %o A354370 while i in aset or not isprime(i): i += 1 %o A354370 while j == i or j in aset or not isprime(i+j): j += 1 %o A354370 while v in aset: v += 1 %o A354370 print(list(islice(agen(), 74))) # _Michael S. Branicky_, Jun 24 2022 %Y A354370 Cf. A354367, A354368, A354369 (same idea), A014076. %K A354370 nonn %O A354370 1,1 %A A354370 _Eric Angelini_ and _Carole Dubois_, May 24 2022