

A274329


Erase all pairs of contiguous terms that sum up to a prime; the remaining terms rebuild the starting sequence.


9



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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

This is the lexicographically earliest such sequence starting with a(1)=1 and showing no duplicate term in any pair to be erased.


LINKS

Lars Blomberg, Table of n, a(n) for n = 1..999


EXAMPLE

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.
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.
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,..."
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).
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.
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.
So "5" disappears with "6" (5+6=11), this "6" being the smallest available integer not yet present in a pair of "erased terms".
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 nonerased terms reproduce the original sequence):
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,2,4,8,12,14,15,11,9,3,1,5,7,13,17,20,16...
^ ^ ^ ^ ^ ^


CROSSREFS

Cf. A303845 for another "erasing criterion" (primes by concatenation).
Sequence in context: A201759 A011170 A304337 * A322398 A341606 A109158
Adjacent sequences: A274326 A274327 A274328 * A274330 A274331 A274332


KEYWORD

nonn,base


AUTHOR

Eric Angelini, Jun 21 2016


STATUS

approved



