For two numbers, $691$ and $697$, tell me which (or both) is prime.
Without using calculator, what is the strategy for tackling this? I tried all the numbers up to 8 which are easy to test. How do you deal with better numbers?
For two numbers, $691$ and $697$, tell me which (or both) is prime.
Without using calculator, what is the strategy for tackling this? I tried all the numbers up to 8 which are easy to test. How do you deal with better numbers?
$$29^2 - 697 = 144 = 12^2$$ so $$ 697 = 29^2 - 12^2 = 17 \cdot 41 $$
This is Fermat's method, it works quickly if there are two factors that are pretty close together. Beginning with $27^2 = 729,$ subtract each number from the square. If the result is a square you get two factors. Otherwise take the next square...
$697=625+72(\to 25^2+2×6^2)=49+648(\to 7^2+2×18^2)$. Both are of the form $a^2+2b^2$, and this nonuniqueness implies proper prime factors $\in\{1,3\}\bmod 8$. Actual factors are $17$ and $41$.
Alternatively, we can set out to prove that $691$ is prime. As this number $\equiv 3\bmod 8$, it is certified prime if it has a unique representation as $a^2+2b^2$ and the squares in this representation are relatively prime.
To prove uniqueness efficiently we need to cut down on trials. To effect this, first note that $a^2$ must be odd and can't end in $5$ ($b^2$ can't end in $3$ or $8$). Then if $a^2$ ends in $1$ it must end in $41$ or $91$ because $b$ would be a multiple of $5$ and thus $2b^2$ would have to be a multiple of $50$. We rule out an ending of $91$, however, because this fails $\bmod 4$.
That leaves only six values of $a^2$ ending with the proper digits and less than $691$, and we try those. Thus $691$ equals each of the following:
$9+682(\to b^2=341)$
$49+642(\to b^2=321)$
$169+522(\to b^2=261)$
$289+402(\to b^2=201)$
$441+250(\to b^2=125)$
$\color{blue}{529+162(\to b^2=81,\therefore a=23,b=9)}$
The existence of a unique sum hits on our very last chance!
The only nontrivial trial divisions can all be done uniformly easily mentally as follows:
$\bmod 13\!:\ \color{#c00}{40\!\equiv\! 1}\Rightarrow\,691={17}(\color{#c00}{40})\!+\!11\equiv\,\ 4\,(\color{#c00}1)+11\equiv 2,\,$ so $\ 691\!+\!6\equiv 8$
$\bmod 17\!:\ \color{#c00}{17\!\equiv\! 0}\Rightarrow\,691=\color{#c00}{17}(40)\!+\!11 \equiv\,\ \color{#c00}{0}\,(40)\!+\!11\!\equiv\! 11,\,$ so $\ 691\!+\!6\color{#0a0}{\equiv 0}$
$\bmod 19\!:\ \color{#c00}{40\!\equiv\! 2}\Rightarrow\,691=17(\color{#c00}{40})\!+\!11\equiv\, (-2)\color{#c00}2\!+\!11\equiv 7,\,$ so $\ 691\!+\!6\equiv 11$
$\bmod 23\!:\ \color{#c00}{17,40\equiv -6}\ \Rightarrow \ \color{#c00}{17(40})\!+\!11\equiv \color{#c00}{-6(-6)}\!+\!11\!\equiv\! 1,\,$ so $\ 691\!+\!6\equiv 7$
More generally see the universal divisibility test, e.g. see here and here.
You should eliminate single digit prime factors first: $2, 3, 5, 7$.
Let us also eliminate 11 since it has an easy to check divisibility rule.
Therefore one of the factor is at least 2 digits.
Answer #1: Use the divisibility rules given here for primes up to 30. This works since the square root of 697 lies between 26 and 27.
Answer #2: Using digital roots
Since the numbers themselves are 3 digits and no single digit factor exists, both factors must be 2 digits (for both numbers).
We have, $p = 10a + b, q = 10c+d$
Further steps for 691:
$pq = (10a + b)(10c + d) = 691$
The digital root of an integer $n$ is denoted by $dr(n)$.
The digital root of $691$ is $dr(691) = 7$.
Using this Vedic square, also shown below, we see that:
$$\{(dr(p),dr(q))\} \equiv \{(1,7), (2,8), (4,4), (5,5), (7,1), (8,2)\}$$
are the possibilities. Due to commutativity of multiplication, we can consider the reduced set:
$$\{(1,7), (2,8), (4,4), (5,5)\}$$
Check the primes $11 < p,q \lt 60$ i.e., $13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59$ Their respective digital roots are: $4, 8, 1, 5, 2, 4, 1, 5, 7, 2, 8, 5$
So, $\{(p,q)\} \in \{(19,43), (37,43), (29,17), (29,53), (47,17), (47,53), (13,13), (13,31), (31,13), (31,31), (23,23), (23,59),(59,23), (59,59)\}$
We can eliminate redundant pairs using commutativity:
So, $\{(p,q)\} \in \{(19,43), (37,43), (29,17), (29,53), (47,17), (47,53), (13,13), (13,31), (31,31), (23,23), (23,59), (59,59)\}$
Using $691 \mod 10 = 1$, we can eliminate pairs leaving
$${(p,q)\} \in {(37,43), (47,53), (31,31), (59,59)}$$
All these products are greater than 691 which can be checked quickly. For eg: $30 \times 40 = 1200, 40 \times 50 = 2000$ and so on.
Therefore, $691$ must be prime.
Further steps for 697:
The digital root of 697 is $dr(697) = 4$.
Using this the Vedic square again, we see that:
$$\{(dr(p),dr(q))\} \equiv \{(1,4), (2,2), (4,1), (5,8), (7,7), (8,5)\}$$
are the possibilities. Due to commutativity of multiplication, we can consider the reduced set:
$$\{(dr(p),dr(q))\} \equiv \{(1,4), (2,2), (5,8), (7,7)\}$$
Check the primes $11 < p,q \lt 60$ i.e., $13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59$ Their respective digital roots are: $4, 8, 1, 5, 2, 4, 1, 5, 7, 2, 8, 5$
So, $\{(p,q)\} \in \{(19,13), (37,13), (19,31), (37,31), (29,29), (29,47), (41,17), (47,29), (47,47), (23,17), (23,53), (43,17), (43,53), (59,17), (59,53)\}$
We can eliminate redundant pairs using commutativity:
So, $\{(p,q)\} \in \{(19,13), (37,13), (19,31), (37,31), (29,29), (29,47), (41,17), (47,47), (23,17), (23,53), (43,17), (43,53), (59,17), (59,53)\}$
Using $697 \mod 10 = 7$, we can eliminate pairs leaving only those marked by the green cells in the figure below:
Of these 15, we can eliminate all whose products are lesser than 697 or greater than 697 by using the product of numbers rounded to nearest 10. For eg: $19 \times 13 < 300$, $29 \times 43 > 800$ and so on. You need to check only 3 products $(667, 697 and 767)$ by hand to find out that $697 = 17 \times 41$
This works for small numbers where we can calculate by hand.
You can also force a condition that $p \le q$, but if we do that we should not do the reduction using the commutativity rule.
For larger integers, I have a conjecture that we may be able to extend this digital roots technique to speed up the recovery of divisors. It is still an evolving idea. See my related question: An old multiplication technique and its reverse for Integer Factoring