A335640 Numbers k of the form r^2 - t*r*s + s^2, where r, s and t are positive integers, r + s = k and t < r <= s.
4, 9, 16, 25, 36, 45, 49, 64, 81, 96, 100, 121, 144, 169, 175, 196, 225, 256, 288, 289, 320, 324, 361, 400, 441, 484, 529, 576, 625, 640, 676, 729, 784, 841, 891, 900, 961, 1024, 1089, 1156, 1200, 1225, 1296, 1350, 1369, 1444, 1521, 1573, 1600, 1681, 1764, 1849, 1936, 2016
Offset: 1
Keywords
Examples
9 is in the sequence since 9 = 3^2 - 2*3*6 + 6^2.
Programs
-
Maple
N:= 3000: # for terms <= N R:= {4}: for t from 2 to N/2 do for r from t+1 to N/2 do c:= r^2-r; b:= 1+t*r; delta:= b^2 - 4*c; if not issqr(delta) then next fi; delta:= sqrt(delta); S:= select(x -> x::posint and x >= r and r+x <= N, {(b+delta)/2,(b-delta)/2}); R:= R union map(`+`,S,r); od od: sort(convert(R,list)); # Robert Israel, Apr 04 2023
-
Mathematica
Table[If[Sum[Sum[KroneckerDelta[i^2 - k*i (n - i) + (n - i)^2, n], {k, i - 1}], {i, Floor[n/2]}] > 0, n, {}], {n, 200}] // Flatten
Comments