A330385 Add the odd terms and subtract the even ones, the result must always be a square. This is the lexicographically earliest sequence of distinct positive integers with this property.
1, 3, 4, 9, 7, 12, 5, 8, 15, 16, 25, 11, 13, 24, 39, 17, 19, 21, 23, 44, 36, 28, 20, 33, 40, 27, 32, 45, 48, 35, 85, 72, 51, 64, 133, 87, 60, 29, 31, 105, 123, 84, 41, 43, 141, 96, 47, 49, 159, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 164, 156
Offset: 1
Examples
The first terms, alongside the corresponding running totals, are: n a(n) t(n) -- ---- -------- 1 1 1 = 1^2 2 3 4 = 2^2 3 4 0 = 0^2 4 9 9 = 3^2 5 7 16 = 4^2 6 12 4 = 2^2 7 5 9 = 3^2 8 8 1 = 1^2 9 15 16 = 4^2 10 16 0 = 0^2 11 25 25 = 5^2
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Scatterplot of the first 5000000 terms
Programs
-
PARI
s=t=0; for (n=1, 65, for (v=1, oo, if (!bittest(s,v) && issquare(u=t-v*(-1)^v), print1 (v", "); s+=2^v; t=u; break)))
Comments