If I don't have a computer at hand (or an app), how can I know that $1637$ is a prime number?
I factored the number $99857$ as $1637\times 61$ and the computer told me that $1637$ is a prime. So would it be easy at all to know this without it?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityIf I don't have a computer at hand (or an app), how can I know that $1637$ is a prime number?
I factored the number $99857$ as $1637\times 61$ and the computer told me that $1637$ is a prime. So would it be easy at all to know this without it?
If it was not prime, it would have a prime factor smaller than or equal to its square root. Since$$40^2=1\,600<1\,637$$and$$41^2-40^2=(41-40)\times(41+40)=81,$$it is clear that $40<\sqrt{1\,637}<41$. So, all you have to do is to check whether $1\,637$ is a multiple of one of the twelve numbers $2,3,5,\ldots,37$.
For a given number $n$ and candidate divisor $d \in \mathbb{P}$, d | n (read "d divides n") iff d | (n + kd).
This trick can be used to speed up the mental calculations you are trying to do. For example, let $n = 1637$ and $d = 17$. The goal is to reduce the statement d | n into a more intuitively true or false statement.
If 17 | 1637, then 17 | (1637 +(-1)*17)
17 | 1620
17 | 162*10
17 | 162
17 | (162 + 17)
17 | 179
17 | (170 + 9)
17 | 9,
Which is false, so 17 does not divide 1637.
Rinse and repeat. (Fun!)
Full answer: this is quite tedious. Shows how useful calculators are!
As others have mentioned, $1637<41^2$ so just check whether it is divisible by $$2,3,5,7,11,13,17,19,23,29,31,37.$$ We can rule out
$2$ as $1637$ is odd
$3$ as the sum of the digits of $1637$ is $17$ which is not divisible by $3$
$5$ as $1637$ does not end in $0$ or $5$
$11$ as the alternating sum is $1-6+3-7=-9$ which is not divisible by $11$.
Time for congruences. By brute force,
$1637\equiv1400+210+28-1\equiv-1\pmod7$ so reject $7$.
$1637\equiv1300+260+78-1\equiv-1\pmod{13}$ so reject $13$.
$1637\equiv1700-68+5\equiv5\pmod{17}$ so reject $17$.
$1637\equiv1900-380+117\equiv117\equiv3\pmod{19}$ so reject $19$.
$1637\equiv1840-184-19\equiv-19\equiv4\pmod{23}$ so reject $23$.
$1637\equiv1740-174-71\equiv-71\equiv13\pmod{29}$ so reject $29$.
$1637\equiv1550+93-7\equiv-7\pmod{31}$ so reject $31$.
$1637\equiv1850-185-28\equiv-28\pmod{37}$ so reject $37$.
DONE!
The trick is to start with the number closest to $1637$ that is divisible by the prime you're working modulo.
If you have a number less than a million or so, the Miller-Rabin primality test will perfectly identify primality with $a=2$ or $a=3$. This is pretty easy to execute by hand. Edit: Just tried to actually execute this by hand, and calculating these large powers mod 409 is pretty laborious. I think this is still doable, not not as simple as I remember.
https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test
If we can show that $1637$ has exactly one representation as a sum of two squares, then we know it's prime.
If there is a representation it must be of the form $1637=(2m-1)^2+(2n)^2$, which implies
$$m^2-m+n^2=409$$
Since $m^2-m=m(m-1)$ is even, we must have $n$ odd, in which case $8\mid(409-n^2)$, so that either $8\mid m$ or $8\mid m-1$, i.e., either $m=8h$ or $m=8h+1$ for some $h$. Writing $n=2k-1$, we find either $64h^2-8h+4k^2-4k+1=409$ or $64h^2+8h+4k^2-4k+1=409$, which reduces to
$$16h^2\pm2h+k^2-k=102$$
with $m=8h$ if the negative sign is used and $m=8h-1$ is the plus sign is used.
It's clear that $16h^2\pm2h+k^2-k\gt102$ if $h\ge3$, so we need only check the values $h=0$, $1$ and $2$.
For $h=0$, the equation $k(k-1)=102=53\cdot2$ has no solutions.
For $h=1$, the equations $k(k-1)=102-(16+2)=84=12\cdot7$ and $k(k-1)=102-(16-2)=88=11\cdot8$ have no solutions.
For $h=2$, the equation $k(k-1)=102-(64+4)=34=17\cdot2$ has no solutions, but the equation $k(k-1)=102-(64-4)=42=7\cdot6$ has a unique (positive) solution.
Unraveling this, we have $n=2k-1=13$ and $m=8h=16$, so that $(2m-1)^2+(2n)^2=31^2+26^2$ is the unique representation of $1637$ as the sum of two squares. Hence $1637$ is prime.
It depends. Some numbers can be what you might consider very large and yet be easy to factor. Numbers like $8575000000000000000000000$. The main difficulty with that one would be to make sure you have correctly counted how many zeroes it has after "$8575$".
Of course either $8574999999999999999999999$ or $8575000000000000000000001$ would be a bit more difficult without the help of some kind of calculator.
Even though $99857$ is quite small, it's actually a little bit more difficult to factor by hand than the first number I mentioned. Obviously it's an odd number, so it's not divisible by $2$.
$9 + 9 + 8 + 5 + 7 = 38$ and $3 + 8 = 11$ and $1 + 1 = 2$, so it's not divisible by $3$ either. Its last digit is not $5$, so it's not divisible by $5$.
Remember that $\sqrt{10} \approx \pi$, which means $\sqrt{10^5}$ is about $314$, and consequently if $99857$ is composite, it's divisible by some prime less than $314$. I've only memorized the primes up to $199$, so this might present some difficulties for me.
At this point I would start to wonder if I really don't have some kind of calculator I can use. Let's say I stuck it out and discovered that $99857$ is divisible by $61$. Assuming I made no silly arithmetic mistakes, I would have $61 \times 1637 = 99857$.
Is it possible that $1637$ might not be prime? No, because if $1637$ is divisible by some prime from $2$ to $59$, I should have discovered it while trial dividing $99857$. The smallest possible prime factor of $1637$ at this point is $61$.
But since $60^2 = 3600$ and $61^2$ is obviously more than that, I now know that $1637$ is not divisible by any prime from $2$ to $61$ and therefore not divisible by any prime from $67$ to whatever is the largest prime less than $1637$.
$1637$. Confession I find it hard.
But $1600=40^2 < 1637$ and $41^2 = 1600 + 80 + 1 > 1637$ so only need to check if it has prime factor $\le 40$.
The usual "doesn't end in an even number" "sum of digits isn't a multiple of 3" and "$1+3 \not \equiv 6+7 \mod 11$" show it is not divisible by $2$, $3$ or $11$.
Those are the only tricks I ever specifically memorized. Other wise I rely on "casting out".
To see if a number is divisible by $p$ add and subtract multiples of $p$ in your head. If you get a multiple of a number relatively primed to $p$ (usually a multiple of $10$) you can divide the result by that number. If you end up with anything but a multiple of $p$ then $p$ does not divide then number.
So, for example to see if $1637$ is divisible by $7$. I subtract $7$ and get $1630$. I divide by $10$ and get $163$. I subtract $9*7 = 63$ to get $100$. I divide by $10$ twice to get $1$. Had $1637$ ben divisible by $7$ all the numbers I would have gotten on the way would have been divisible by $7$ to and I wouldn't have gotten $1$. So $1637$ is not divisible by $7$.
(Down side: If I want to know $1637 \equiv x\mod 7$ this will not tell me anything.)
For $13$. $1637 = 1300 + 337$. $337 = 260 + 77$. ANd $7 = 7*11$ so it is not divisible by $13$.
For $17$. $1637 = 1620 + 17$. $162 = 81*2$. $81 -17=64$. $64 =2^6$ so no go.
For $19$. $1637 = 1618 + 19$. $1618 = 809*2$. $809 = 790 + 19$. $790 = 79*10$. $79-19 = 60 = 6*10$. $6$?. No go.
For $23$, $1637 = 2300 - 600 + 23 + 14$. $-600 + 690 + 14 = 104$. $4*23 = 100 -8$ so $104 = 4*23 + 8 + 4$. No go.
For $29$ $1637 = 1608 + 29$. Wait, let try something different. $1637 -3*29 = 1637 - 3*20 - 27 = 1610 - 60 = 155$. And $5*29 = 5*(30-1) = 145$. $155-145 = 10$ so no go.
$31$: $1637+ 93 = 1730$. $173 - 93 = 80$. No go.
$37$: $1637 = 1600 + 37$. and $16= 2^4$. No go.
It's not divisible by any prime less than $41$. It is less than $41^2$ so it is not divisible by any prime greater than $41$ (other than itself). SO it is prime.