login
A397728
a(0) = 0, a(1) = 1; for k = 0, 1, ..., append a(k) + p and a(k) + q with 0 < p < q two prime numbers as small as possible so as to avoid duplicates.
3
0, 1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 11, 13, 17, 12, 16, 14, 18, 15, 19, 21, 23, 20, 22, 24, 28, 26, 30, 34, 36, 25, 29, 27, 33, 31, 37, 35, 41, 32, 38, 42, 48, 40, 44, 46, 52, 39, 43, 45, 51, 47, 53, 57, 59, 49, 55, 61, 67, 63, 65, 73, 77, 54, 56, 58, 60, 50, 64
OFFSET
0,3
COMMENTS
A permutation of the nonnegative integers: all terms are distinct; if all the values up to v >= 0 with the same parity as v have appeared, v+2 necessarily appears, at the latest, as the first child of v; as the sequence contains 0 (respectively 1), it contains every even numbers (respectively every odd numbers).
EXAMPLE
The first terms, arranged as two binary trees, are:
____0____ ____1____
| | | |
__2_ __3_ __4_ __6_
| | | | | | | |
5 7 8 10 9 11 13 17
PROG
(PARI) \\ See Links section.
CROSSREFS
Cf. A397726, A397729 (inverse).
Sequence in context: A371424 A371425 A361940 * A361926 A397729 A332805
KEYWORD
nonn,new
AUTHOR
Rémy Sigrist, Jul 08 2026
STATUS
approved