A330403 Lexicographically earliest sequence of distinct positive terms with an associate sequence t such that t(0) = 0, and for any n > 0, at least one of t(n-1) - a(n) or t(n-1) + a(n) is a square; in case t(n-1) - a(n) is a square, set t(n) = t(n-1) - a(n), otherwise set t(n) = t(n-1) + a(n).
1, 3, 4, 9, 5, 12, 7, 8, 15, 16, 25, 11, 13, 24, 21, 32, 20, 33, 40, 27, 28, 17, 19, 36, 39, 56, 45, 35, 48, 49, 64, 55, 72, 63, 23, 57, 60, 77, 65, 84, 44, 52, 29, 31, 68, 37, 80, 41, 76, 99, 81, 95, 51, 69, 87, 105, 123, 43, 88, 47, 92, 141, 96, 129, 111, 93
Offset: 1
Keywords
Examples
The first terms, alongside t(n), are: n a(n) t(n) -- ---- ---- 0 N/A 0 1 1 1 2 3 4 3 4 0 4 9 9 5 5 4 6 12 16 7 7 9 8 8 1 9 15 16 10 16 0 11 25 25 12 11 36
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, PARI program for A330403
Programs
-
PARI
See Links section.
Comments