login
A397726
a(0) = 0; for k = 0, 1, ..., append a(k) + r^2 and a(k) + s^2 with 0 < r < s as small as possible so as to avoid duplicates.
3
0, 1, 4, 2, 5, 8, 13, 3, 6, 9, 14, 12, 17, 22, 29, 7, 19, 10, 15, 18, 25, 23, 30, 16, 21, 26, 33, 31, 38, 45, 54, 11, 32, 20, 28, 35, 46, 24, 40, 27, 34, 41, 50, 39, 48, 55, 66, 52, 65, 37, 57, 42, 51, 49, 58, 47, 56, 63, 74, 61, 70, 79, 90, 36, 60, 68, 81, 69
OFFSET
0,3
COMMENTS
Using powers of 2 instead of squares yields A081241 prefixed by 0.
Using Fibonacci numbers instead of squares yields A095903 prefixed by 0.
A permutation of the nonnegative integers: all terms are distinct; the sequence contains 0; if all the values up to v >= 0 have appeared, v+1 necessarily appears, at the latest, as the first child of v.
EXAMPLE
The first terms, arranged as a binary tree, are:
________0________
| |
____1___ ____4___
| | | |
__2_ __5_ __8_ _13_
| | | | | | | |
3 6 9 14 12 17 22 29
PROG
(PARI) \\ See Links section.
CROSSREFS
Cf. A081241, A095903, A397727 (inverse), A397728.
Sequence in context: A112962 A226457 A349244 * A277390 A200608 A163358
KEYWORD
nonn,tabf,new
AUTHOR
Rémy Sigrist, Jul 07 2026
STATUS
approved