How can I prove that the last digit of a prime number other than $ 2 $ and $ 5 $ can be $ 1,3,7,9 $ without using Dirichlet's theorem?

It occurs to me to try to prove that

$ 4n + 1 \equiv a_n \pmod {10} $

$ 4n + 3 \equiv a_n \pmod {10} $

with $ a_n = \{1,3,7,9 \} $

  • 1
    $\begingroup$ As stated, you just need to exhibit primes with those last digits, like $11,13,7,19$ and you are done. I believe you mean to ask how to prove that all primes other than $2$ and $5$ end in one of those digits. $\endgroup$ – Ross Millikan Oct 31 at 4:21

If the last digit is $2,4,6,8,0$ the number is even. If the last digit is $5$ the number is divisible by $5$. Thus, if the number is prime it can only end in $1,3,7,9$.

In general, primes in base $n$ that are greater than $n$ can only have last digits coprime to $n$.

Specific primes that end in $1,3,7,9$ are $11,13,17$ and $19$.

| cite | improve this answer | |
  • 2
    $\begingroup$ And in base 2 the last digit can only be 1. So generally in base n, the last digit(s) can only be... what subset of {0,...,n-1}? $\endgroup$ – John Forkosh Oct 31 at 4:10
  • $\begingroup$ (at)ParclyTaxel for anybody. What's the function $f:\mathbb N \to 2^{\mathbb N}$ such that $f(n)\subseteq\{0,\ldots,n-1\}$ is the appropriate subset? $\endgroup$ – John Forkosh Oct 31 at 4:35
  • $\begingroup$ (at)ParclyTaxel Thanks. $\endgroup$ – John Forkosh Oct 31 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.