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 A274329 #23 Dec 02 2019 04:13:12 %S A274329 1,2,4,3,1,5,6,2,4,8,9,3,1,5,7,10,6,2,4,8,12,11,9,3,1,5,7,13,16,10,6, %T A274329 2,4,8,12,14,15,11,9,3,1,5,7,13,17,20,16,10,6,2,4,8,12,14,18,19,15,11, %U A274329 9,3,1,5,7,13,17,21,22,20,16,10,6,2,4,8,12,14,18,24,23,19,15,11,9,3,1 %N A274329 Erase all pairs of contiguous terms that sum up to a prime; the remaining terms rebuild the starting sequence. %C A274329 This is the lexicographically earliest such sequence starting with a(1)=1 and showing no duplicate term in any pair to be erased. %H A274329 Lars Blomberg, <a href="/A274329/b274329.txt">Table of n, a(n) for n = 1..999</a> %e A274329 As a(1)=1, the next term will be a(2)=2. This pair sums up to a prime (1+2=3) and will thus be erased later. %e A274329 We cannot have a(3)=3 as a(2) and a(3) also sum up to a prime (2+3=5), which is confusing [because, by construction, the same term (here "2") cannot belong to more than one pair]. Thus a(3)=4. %e A274329 As the first pair (1,2) will be erased, we must erase this "4" too, else the future copy of this sequence will not start with "1,2,..." %e A274329 To erase this "4" we take the smallest available integer not yet present in a pair of "erased terms" (as ruled in the "Comments" section), that will sum up to a prime with "4". This is "3" (as 4+3=7). %e A274329 The next term will be "1", as this "1" doesn't sum up to a prime with "3" (the term placed before "1"), and "1" can start the future copy of this sequence. %e A274329 The next term cannot be "2", because this "2" would erase "1" (2+1=3), and we don't want that. Thus a(6)=5. But if we don't erase this "5", the future copy of this sequence will start with 1,5,... which is wrong: it has to start with 1,2,... as the original one. %e A274329 So "5" disappears with "6" (5+6=11), this "6" being the smallest available integer not yet present in a pair of "erased terms". %e A274329 The next term can now be "2", and we see the copy of the original sequence getting slowly build (the erased terms are underlined below; the non-erased terms reproduce the original sequence): %e A274329 1,2,4,3,1,5,6,2,4,8,9,3,1,5,7,10,6,2,4,8,12,11,9,3,1, %e A274329 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ %e A274329 5,7,13,16,10,6,2,4,8,12,14,15,11,9,3,1,5,7,13,17,20,16... %e A274329 ^ ^ ^ ^ ^ ^ %Y A274329 Cf. A303845 for another "erasing criterion" (primes by concatenation). %K A274329 nonn,base %O A274329 1,2 %A A274329 _Eric Angelini_, Jun 21 2016