Why is the reverse of a prime about $45\%$ more likely to be a prime than that of a composite

analytic-number-theorydivisibilityelementary-number-theorynumber theoryprime numbers

Consider two cases a) we reverse the digits of a prime number b) we reverse the digits of a composite number. Are we more likely to obtain a prime in case a) or in case b). Since the last digit of primes other than $2$and $5$ end in $1,3,7$ or $9$ hence if a prime or composite number begins in $2,4,5, 6$ or $8$ there is no way its reverse will be a prime. So to make a fair comparison, I only considered those prime and composite numbers whose first and last digits is $1,3,7$ or $9$.

Let $C$ and $P$ be the set of such composites and prime numbers respectively. I looked at the first $10^8$ numbers (in ascending order) in $C$ and observed the density of numbers whose reverse is a prime is roughly $\frac{2.4n}{\log n}$. However in case of the set $P$, the density of roughly $\frac{3.5n}{\log n}$ i.e. about $45\%$ higher which is significant.

Question: Given the set of numbers whose first and last digits is $1,3,7$ or $9$, why is the reverse of a prime about $45\%$ more likely to be a prime than that of a composite?

Best Answer

  1. If a composite number is divisible by 3, the sum of its digits is also divisible by 3.

  2. If a composite number is divisible by 11, the alternating sum of its digits is also divisible by 11.

Just two of those facts will give you a $\frac13+\frac1{11}=43\%$ better chance. You can further increase this number by starting adding up rarer cases. For example, if the number of digits in $p$ is a multiple of 3, then if $p = \overline{a_1a_2a_3a_4a_5a_6\ldots}$ is divisible by 7, then $(a_1+2a_2+a_3)+(a_4+2a_5+a_6)+...$ is also divisible by 7.