Let
By Fermat'
s little
theorem,
l∣p−1. If the digit count
L is
a multiple of
l, then
10L≡1(modp). The
cyclic decimal divisibility relation gives
and hence also
modulo p. Since
p>7 is
coprime to
10, every
10j is
a unit
modulo p. Therefore
for every
j. Since
c0(n)=n, this proves the required equivalence.