# Why does every number of shape ababab is divisible by $13$?

Why does it seems like every number $ababab$, where $a$ and $b$ are integers $[0, 9]$ is divisible by $13$?

Ex: $747474$, $101010$, $777777$, $989898$, etc...

Note that $$[ababab] = a\times 101010 + b \times 10101 = 13 (7770a + 777b)$$

Also noteworthy: $$10101 = 1 + 10^2 + 10^4 \equiv \\ 1 + 3^2 + 3^4 = 1 + 9 + 9^2 \equiv\\ 1 +(-4) + (-4)^2 = 1 - 4 + 16 = 13 \equiv 0$$ where $\equiv$ indicates equivalence modulo $13$.

• Can you provide an intuition on how you got to that decomposition?
– Juan
Jun 7, 2016 at 20:57
• @Juan you can look at my answer for the intuition or simply multiply and adding everything in the second line of this answer will tell you the intuition. Jun 8, 2016 at 2:23
• @Juan I explain how it arises in my answer. Jun 20, 2016 at 19:53
• I guess you want $3^2=9$, not $3^2=9^2.$
– user940
Jun 20, 2016 at 19:55

These numbers are of the form $(10a+b)\cdot 10101$, and $10101=13\cdot 777$.

• So they are also all divisible by 7 and 37! Jun 7, 2016 at 15:52
• @BenBlum-Smith Indeed, and by 3. Jun 7, 2016 at 15:55

Note: $$ab=a\times 10+b\times 1$$

so $$ab\times 100=ab00$$ therefore

$$abab=ab00+ab=ab(100+1)=ab\times 101$$ $$abab00=ab\times101\times100=ab\times10100$$ $$ababab=ab\times10101=ab\times3\times7\times13\times37$$

Hence it is divisible by $3$,$7,13$ and $37$.

A number $ABCDEF$ is divisible by $13$ if and only if $ABC-DEF$ is divisible by $13$.

Note that $\small{ABA-BAB=100(A-B)+10(B-A)+1(A-B)=91A-91B=13(7A-7B)}$.

Therefore $ABA-BAB$ is divisible by $13$.

Therefore $ABABAB$ is divisible by $13$.

• "ABC−DEF is divisible by 13". (Hint of) proof? Or link to? Jun 7, 2016 at 19:48

And not only that: Each such number is also divisible by the other primes 3, 7 and 37. Just factor the number 10101! Your specimen number is any 2-digit number $\times 10101\,$.

$abcabc=abc(10^3+10^6)=abc\cdot 1001000=abc\cdot13\cdot77000$.

REMARK.-It is easy generalisable to $abcabcabcabcabc.....abcabc$ for $2n$ times abc.

$ababab$ is a multiple of $10101$, which in turn is a multiple of $13$.

Hint $\,\ {\rm mod}\ 13\!:\,\ 10\equiv 6^2\,\Rightarrow\, 10^6\equiv 6^{12}\equiv 1\,$ by little Fermat.

Hence $\, 0\equiv 10^6-1 \equiv (10^2\!-1)(10^4\!+10^2\!+1) \equiv 99\cdot 10101$

Thus $\,99\not\equiv 0\,\Rightarrow\,10101\equiv 0\,\Rightarrow\, ab\cdot 10101 = ababab\equiv 0,\,$ for $\, 0 \le ab \le 99$

$100^0 \equiv 1 \bmod 13$

$100^1 \equiv 9 \bmod 13$

$100^2 \equiv 3 \bmod 13$

$(ababab)_{10}=c100^2+c100+c =c(100^2+100+1) \equiv c(3+9+1) \equiv 0 \bmod 13$, where $c=10a+b$.