OFFSET
1,1
MATHEMATICA
r = 2781; lst = Table[0, {r}]; lim = Floor[Sqrt[8*r - 7]]; Do[num = (i^2 + i)/2 + (j^2 + j)/2; If[num <= r, lst[[num]]++], {i, lim}, {j, i - 1}]; Flatten@Position[lst, 4]
Module[{nn=80, trnos}, trnos=Accumulate[Range[nn]]; Select[PositionIndex[ Sort[ Counts[Total/@Subsets[trnos, {2}]]]][4], #<=Last[trnos]&]] (* The program uses the PositionIndex and Counts functions from Mathematica version 10 *) (* Harvey P. Dale, Dec 25 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Arkadiusz Wesolowski, Dec 02 2015
STATUS
approved