A180436 Palindromic numbers which are sum of consecutive squares.
1, 4, 5, 9, 55, 77, 121, 181, 313, 434, 484, 505, 545, 595, 636, 676, 818, 1001, 1111, 1441, 1771, 4334, 6446, 10201, 12321, 14641, 17371, 17871, 19691, 21712, 40804, 41214, 42924, 44444, 44944, 46564, 51015, 65756, 69696, 81818, 94249, 97679, 99199
Offset: 1
Examples
1001 is in the sequence because 1001 is palindromic and it can be written as sum of consecutive squares (1001 = 4^2 + 5^2 + 6^2 + ... + 13^2 + 14^2).
Links
- Giovanni Resta, Table of n, a(n) for n = 1..10400 (terms < 10^18, first 228 terms from Robert G. Wilson v)
Programs
-
Mathematica
palQ[n_Integer] := Block[{idn = IntegerDigits[n]}, idn == Reverse[idn]]; lst = {}; k = 1; While[k < 1000, AppendTo[lst, Select[ Accumulate[ Range[k, 1000]^2], palQ]]; lst = Union@ Flatten@ lst; k++]; Select[lst, # < 10^6 &] (* Robert G. Wilson v, May 28 2012 *)
Comments