This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A061786 #13 Oct 17 2023 15:11:19 %S A061786 1,3,6,10,15,21,27,34,42,52,61,72,83,94,108,122,135,151,165,183,200, %T A061786 218,234,254,275,296,317,339,361,387,409,434,460,484,512,542,570,598, %U A061786 627,661,689,722,753,784,821,854,888,925,960,998,1036,1075,1109,1148 %N A061786 Number of distinct sums i^2 + j^2 for 1<=i<=j<=n. %H A061786 Alois P. Heinz, <a href="/A061786/b061786.txt">Table of n, a(n) for n = 1..1000</a> %e A061786 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. %p A061786 b:= proc(n) b(n):= {seq(n^2+i^2, i=1..n)} end: %p A061786 s:= proc(n) s(n):= `if`(n=0, {}, b(n) union s(n-1)) end: %p A061786 a:= n-> nops(s(n)): %p A061786 seq(a(n), n=1..100); # _Alois P. Heinz_, May 07 2014 %t A061786 f[x_] := x^2 Table[Length[Union[Flatten[Table[f[u]+f[w], {w, 1, m}, {u, 1, m}]]]], {m, 1, 75}] %o A061786 (Python) %o A061786 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 %Y A061786 Cf. A000217. %K A061786 nonn %O A061786 1,2 %A A061786 _Labos Elemer_, Jun 22 2001