I have problems with my math:
Suppose we have a function: F (x, y) = P; And my question is: what is the most efficient way to calculate the appropriate (x, y) graphs for this function? This means that I do not need coordinates, but I need a number . P is in the range: [0; 10 ^ 14]. "x" and "y" are integers. Is this solved with bruteforce or are there some advanced tricks (math / programming language (C, C ++)) to solve this problem quickly enough?
To be more specific, the function: x * y - ((x + y) / 2) + 1.
x*y - ((x+y)/2) + 1 == Pequivalent to (2x-1)(2y-1) == (4P-3).
x*y - ((x+y)/2) + 1 == P
(2x-1)(2y-1) == (4P-3)
, 4P-3. C ++, , , . [: , A*B == C, , , (-A)*(-B) == C ].
4P-3
A*B == C
(-A)*(-B) == C
C ++, , , , 4 * 10^14. int , long long.
4 * 10^14
int
long long
.
, , , . , , , , F<P, F>P, - F P.
F<P
F>P
( , , , , F '= FP), . . , !
, .