0
$\begingroup$

I have a number N i want to subtract square of x from N , where x is any integer

Num = N-x*x

Such that Num can be represent as square of two numbers.

i.e Num= a^2+b^2  where a and b are integers

As far as i know to represent a number summation of two square it's prime factor of form 4k+3 should occur even times.

But how to determine x in most efficient way ?
i tried some random cases it's always possible to do so

  • 0
    `x` can be zero2017-01-11
  • 1
    What do you mean "as a square of two numbers"? Do you mean "as a sum of two squares", or something else? Also, if that _is_ what you mean, isn't your problem best phrased as "I want to write a given number as the sum of three squares"? In that case, try $7$.2017-01-11
  • 0
    what do you mean "NUM can be represent as square of two numbers"?2017-01-11

0 Answers 0