Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 4.1.21* (About Fermat's method of factorization)
Exercise 4.1.21* (About Fermat's method of factorization)
Let be an odd positive integer. If factors into the product of two integers, , with and , prove that the roots of are integers.
Hint. Use the identity to get bounds on the integer .
Answers
Proof. By hypothesis,
Since is odd, and are odd, so and are integers.
We know also that , thus , and , so
This gives the inequalities
Therefore
or equivalently
Moreover, since ,
Then the inequalities (1) give
where is an integer, so
Then . The relations
show that the integers and are the roots of
If , with and , the roots of are integers. □
Note: This problem seems related to Fermat’s method to factor an integer by representing as difference of two squares. This method is efficient if the factors are close.
To choose two primes numbers for the RSA method in cryptography, it is dangerous to take and too close.
To give a (very little) example, take .
Then , , and the previous equation
has for solutions the two integers and :
sage: solve(x^2 - 433914*x + 47070339749, x) [x == 216967, x == 216947]
so
and the code is deciphered.
(To find the decomposition , we can also find and by increasing , starting from , , and increasing until .)