OFFSET
0,3
COMMENTS
This sequence is a permutation of the nonnegative as each term belongs to a run of one or two terms summing to a square number, and after such a run we can extend the sequence with the least missing value.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Rémy Sigrist, PARI program
EXAMPLE
The first terms and corresponding square numbers are:
n a(n) Squares
-- ---- -----------------------------
0 0 a(0) = 0^2
1 1 a(0) + a(1) = 1^2, a(1) = 1^2
2 2 a(2) + a(3) = 3^2
3 7 a(2) + a(3) = 3^2
4 3 a(4) + a(5) = 3^2
5 6 a(4) + a(5) = 3^2
6 4 a(6) = 2^2, a(6) + a(7) = 3^2
7 5 a(6) + a(7) = 3^2
8 8 a(8) + a(9) = 5^2
9 17 a(8) + a(9) = 5^2
10 9 a(10) = 3^2
11 10 a(11) + a(12) = 5^2
12 15 a(11) + a(12) = 5^2
13 11 a(13) + a(14) = 5^2
14 14 a(13) + a(14) = 5^2
15 12 a(15) + a(16) = 5^2
16 13 a(15) + a(16) = 5^2
17 16 a(17) = 4^2
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Aug 15 2025
STATUS
approved
