login
A320728
Numbers that are sums of consecutive odd squares (or centered octagonal numbers).
5
0, 1, 9, 10, 25, 34, 35, 49, 74, 81, 83, 84, 121, 130, 155, 164, 165, 169, 202, 225, 251, 276, 285, 286, 289, 290, 361, 371, 394, 420, 441, 445, 454, 455, 514, 515, 529, 596, 625, 645, 650, 670, 679, 680, 683, 729, 802, 804, 841, 875, 885, 934, 959, 961, 968, 969, 970, 1044, 1089
OFFSET
1,3
PROG
(PARI) ok(n)={my(i=sqrtint(n)); i=i-(i%2==0); while(i>0, my(a=i^2, j=i); while(j>0 && a<=n, if(a==n, return(1)); j-=2; a=a+j^2); i-=2); 0}
concat([0], select(ok, [1..1200])) \\ Antonio Roldán, Mar 12 2020
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 21 2018
STATUS
approved