OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
If the {s+t} sums are generated by addition 2 terms of an S set consisting of n different entries, then at least 1, at most n(n+1)/2=A000217(n) distinct values can be obtained. The set of first n squares gives results falling between these two extremes. E.g. S={1,4,9,16,25,36,49} provides 27 different sums of two, not necessarily different squares: {2,5,8,10,13,17,18,20,25,26,29,32,34,37,40,41,45,50,52,53,58,61,65,72,74,85,98}_ Only a single sum arises more than once: 50=1+49=25+25. Therefore a(7)=(7*8/2)-1=27.
MAPLE
b:= proc(n) b(n):= {seq(n^2+i^2, i=1..n)} end:
s:= proc(n) s(n):= `if`(n=0, {}, b(n) union s(n-1)) end:
a:= n-> nops(s(n)):
seq(a(n), n=1..100); # Alois P. Heinz, May 07 2014
MATHEMATICA
f[x_] := x^2 Table[Length[Union[Flatten[Table[f[u]+f[w], {w, 1, m}, {u, 1, m}]]]], {m, 1, 75}]
PROG
(Python)
def A061786(n): return len({i**2+j**2 for i in range(1, n+1) for j in range(1, i+1)}) # Chai Wah Wu, Oct 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jun 22 2001
STATUS
approved