A387058 Lexicographically earliest sequence of distinct nonnegative integers such that each term is a square number or belongs to a run of two consecutive terms summing to a square number.
0, 1, 2, 7, 3, 6, 4, 5, 8, 17, 9, 10, 15, 11, 14, 12, 13, 16, 18, 31, 19, 30, 20, 29, 21, 28, 22, 27, 23, 26, 24, 25, 32, 49, 33, 48, 34, 47, 35, 46, 36, 37, 44, 38, 43, 39, 42, 40, 41, 45, 55, 50, 71, 51, 70, 52, 69, 53, 68, 54, 67, 56, 65, 57, 64, 58, 63, 59
Offset: 0
Keywords
Examples
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
- Rémy Sigrist, PARI program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
\\ See Links section.
Comments