Sum of two numbers as sum of two squares

92 Views Asked by At

Given a number $X$ , we need to find a number $Y$ such that $X+Y$ can be expressed as sum of two squares (say $a^2+b^2$).

It can be observed that number of $Y$ are infinite (and can be generated by plugging value of a and b in $a²+b²-X$).

But, how can we find $Y$ for given number $X$ so X+Y² can be expressed as sum of two squares?

Edit : for example if $X=32$ is given, than $Y$ can be $3$ such that $32 + 3² = 41$ and $41$ can be split into sum of squares of $4$ and $5$ ($4² + 5² = 41$).

2

There are 2 best solutions below

0
On BEST ANSWER

Choose an $a$ so that $X-a^2$ is odd: $$X-a^2=2Y+1=(Y+1)^2-Y^2,$$and that implies $$X+Y^2=a^2+(Y+1)^2.$$

0
On

If $X$ is even number, we can get a solution below.
$(a-b)^2+2ab=a^2+b^2$
Hence $Y=a-b, X=2ab$.