OFFSET
1,1
EXAMPLE
231 = 21 + 210 = 78 + 153.
276 = 45 + 231 = 66 + 210 = 105 + 171.
MATHEMATICA
(P=PolygonalNumber)[3, Select[Range@176, Length@Select[Subsets[P[3, Range[s=#]], {2}], Total@#==P[3, s]&]>1&]] (* Giorgos Kalogeropoulos, Dec 31 2021 *)
PROG
(Python)
from collections import Counter
from itertools import count, takewhile, combinations as combs
def aupto(limit):
tris = takewhile(lambda x: x <= limit, (k*(k+1)//2 for k in count(1)))
trilst = list(tris); triset = set(trilst)
tri2ct = Counter(sum(c) for c in combs(trilst, 2) if sum(c) in triset)
return sorted(t for t in tri2ct if t <= limit and tri2ct[t] > 1)
print(aupto(16000)) # Michael S. Branicky, Dec 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Shyam Sunder Gupta, Dec 27 2021
STATUS
approved