|
|
A111302
|
|
Define a(1)=1. Thereafter a(n) is the smallest positive integer with the property that a(n)^2 cannot be created by summing the squares of at most n values chosen among the previous terms (with repeats allowed).
|
|
0
|
|
|
1, 2, 4, 9, 12, 16, 27, 49, 69, 118, 187, 305, 503, 829, 1590, 2529, 4173, 7189, 13771, 22854, 43460, 57549, 135271, 222070, 426775, 724479, 1246636, 2158543, 3713979, 6063658, 11725956, 19627746
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) <> 3 because we can write 3^2 = a(2)^2 + a(2)^2 + a(1)^2 by using not more than 3 terms.
But it is impossible to write 4^2 as the sum of at most three squares of the previous elements, thus a(3)=4.
|
|
PROG
|
(PARI) canMake(n, v, i, left) = local(c); if (i == 0, return(n <= left)); c = v[i]; if (n > left*c, return(0)); if (!(n%c), return(1)); forstep (j = n\c, 0, -1, if (canMake(n - j*c, v, i - 1, left - j), return(1))); 0;
v = vector(60); x = 2; for (m = 2, 61, while (canMake(x^2, v, m - 2, m), x++); v[m - 1] = x^2; print1(x, ", "); x++); \\ David Wasserman, Jan 09 2009
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|