OFFSET
2,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..800
EXAMPLE
a(9) = 4 since 9^2 = 7^2 + 4^2 + 4^2.
MAPLE
b:= proc(n, i) option remember; (s-> `if`(i=1, 1,
`if`(s>=n and issqr(n), isqrt(n), max(
`if`(s>n, 0, b(n-s, i)), b(n, i-1)))))(i^2)
end:
a:= n-> b(n^2, n-1):
seq(a(n), n=2..75); # Alois P. Heinz, Nov 03 2020
MATHEMATICA
b[n_, i_] := b[n, i] = Function[s, If[i == 1, 1,
If[s >= n && IntegerQ@Sqrt[n], Sqrt[n], Max[
If[s > n, 0, b[n-s, i]], b[n, i-1]]]]][i^2];
a[n_] := b[n^2, n-1];
Table[a[n], {n, 2, 75}] (* Jean-François Alcover, May 08 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Title improved by Sean A. Irvine, Nov 03 2020
STATUS
approved