OFFSET
4,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 4..4000
EXAMPLE
a(6) = 2: {1,4,5,6}, {2,3,5,6}.
a(7) = 5: {1,2,6,7}, {1,3,5,7}, {1,4,5,6}, {2,3,4,7}, {2,3,5,6}.
a(8) = 8: {1,2,5,8}, {1,2,6,7}, {1,3,4,8}, {1,3,5,7}, {1,4,5,6}, {2,3,4,7}, {2,3,5,6}, {4,6,7,8}.
MAPLE
b:= proc(n, i, t) option remember;
`if`(i<t, 0, `if`(n=0, `if`(t=0, 1, 0),
`if`(t<1 or n<t*(t+1)/2 or n>(t+1)*(2*i-t)/2, 0,
`if`(i>n, 0, b(n-i, i-1, t-1))+b(n, i-1, t))))
end:
a:= proc(n) option remember; `if`(n<0, 0, a(n-1)+add(
b(j^2-n, n-1, 3), j=isqrt(n-6)..isqrt(4*n-6)))
end:
seq(a(n), n=4..60);
MATHEMATICA
Table[Count[Subsets[Range[n], {4}], _?(IntegerQ[Sqrt[Total[#]]]&)], {n, 4, 60}] (* Harvey P. Dale, Mar 06 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Feb 01 2017
STATUS
approved