19451945 is a sum of 2 distinct squares.
Find
ALL qualifying pairs (x,y).
To avoid duplicity assume x>y>0.
Keep a list of squares (sq) and see if the difference between 19451945 and any number squared is a member of this list:
sq=(1:4410).^2;
t=19451945;
for i=1:4410
if ismember(t-sq(i),sq)
if i>sqrt(t-sq(i))
disp([i,i^2,sqrt(t-sq(i)),(t-sq(i))])
end
end
end
finds
x x^2 y y^2
3149 9916201 3088 9535744
3539 12524521 2632 6927424
3676 13512976 2437 5938969
3724 13868176 2363 5583769
4229 17884441 1252 1567504
4372 19114384 581 337561
4397 19333609 344 118336
4403 19386409 256 65536
|
Posted by Charlie
on 2023-03-14 11:59:57 |