# Is it true that all senary numbers ending in 1 and 5 are primes?

I was reading the Wikipedia article on senary numbers (base 6), which states that:

all primes, when expressed in
base-six, other than 2 and 3 have 1 or
5 as the final digit

Unless I am converting to senary incorrectly, I find this not to be true. For example, the senary representation of the decimal number 2047 is ‘13251’, which would be a prime according to the stated rule, but is not (2047 = 89 * 23).

Is my conversion correct? Is the stated rule incorrect?

#### Solutions Collecting From Web of "Is it true that all senary numbers ending in 1 and 5 are primes?"

You are misinterpreting the statement. “All primes satisfy property $X$” means “If $p$ is prime, then $p$ has property $X$.” You have instead interpreted it as “If $p$ has property $X$, then $p$ is prime.”

The statement is true, because if $p$ is a prime greater than $3$, then $p$ is not divisible by $2$ or $3$, whereas a number whose base six expansion ends in $0$, $2$, or $4$ is even and a number whose base six expansion ends in $0$ or $3$ is a multiple of $3$.

As said, you have misread the statement. This is a special case of the fact that for an odd prime $\rm\:p\:,\:$ $\rm\: \phi(2\:p)\ =\ \phi(p)\ =\ p-1\:,\$ i.e. there are $\rm\: p-1\:$ naturals below $\rm\:2\:p\:$ that are coprime to $\rm\:2\:p\:,\:$ namely all $\rm\:p\:$ odd numbers below $\rm\:2\:p\$ excepting $\rm\:p\:.\$ Hence, modulo $\rm\:2\:p\:,\:$ an odd prime $\rm\ne p\:$ must lie in one of these congruence classes (else it has a nontrivial gcd with $\rm\:2\:p\:,\:$ so it is composite). $\:$ Hence if $\rm\:q\:$ is prime then $\rm\ q\equiv 1,5\ \ (mod\ 6)\:;\ \ q\equiv 1,3,7,9\ \ (mod\ 10)\:;\ \ q\equiv 1,3,5,9,11,13\ \ (mod\ 14)\$ etc, assuming that $\rm\:q\:$ is coprime to the modulus. Exploiting reflection symmetry we can state this more succinctly: $\rm\ \ q\equiv \pm 1\ \ (mod\ 6)\:;\ \ q\equiv \pm\{1,3\}\ \ (mod\ 10)\:;\ \ q\equiv\pm \{1,3,5\}\ \ (mod\ 14)\$ and, more generally, $\rm\:\ \ \ q\equiv \pm\{1,3,5,\cdots,p-2\}\ \ (mod\ 2\:p)\$

The relationship in the quote is a subset. All primes in base 6, other than 2 and 3, is a subset of all numbers ending in 1, 5. There are composite numbers that end in the same digits, since all numbers coprime to six end in 1,5 base 6.

41 = dec 25 = 5*5 , and 205 = 11 * 15 = dec 77 evidently are not primes, but are co-prime to 6.