Let p=1+a+a2+⋯+am be a prime number, where a>1 and m>2 are integers. Prove that p10p−1−1 is a good number.
*Proof*. Since p=1+a+⋯+am=a−1am+1−1 is a prime number, q=m+1 must be a prime number. Given q=m+1>3, we have q≥5. Note that p=a−1aq−1 divides aq−1 and does not divide a−1, so the order of a modulo p is exactly q. Therefore, q∣p−1. Let p−1=qL.
Consider the remainder t of 10L=10(p−1)/q modulo p, which satisfies tq≡1(modp). By Lagrange's theorem, the solutions to the congruence equation xq−1≡0(modp) are exactly {1,a,a2,⋯,aq−1}. Thus, we can assume t=ar, where r∈D={0,1,⋯,q−1}. Furthermore, 10kL modulo p is a⟨kr⟩, where ⟨⋅⟩ denotes the remainder modulo q, taking values in D={0,1,⋯,q−1}.
Consider N=p10p−1−1=p10qL−1=⌊p10qL−1⌋ as a p−1 digit number, with leading zeros if necessary. Divide N into segments of length L from left to right (the leftmost segment may contain leading zeros), forming q segments corresponding to integers x0,x1,⋯,xq−1:
x0x1\multicolumn2c………xk=⌊p10L⌋=p10L−ar,=⌊p102L⌋−10L⋅x0=p102L−a⟨2r⟩−10L⋅p10L−ar=par⋅10L−a⟨2r⟩,=pa⟨kr⟩⋅10L−a⟨(k+1)r⟩,k=1,2,⋯,q−1.
If r=0, then x0=x1=⋯=xq−1=p10L−1 can be divided into two groups, each forming a geometric sequence.
If r∈{1,2,⋯,q−1}, then {⟨kr⟩∣k=0,1,⋯,q−1}={0,1,2,⋯,q−1}. Let
A={k∈D∣⟨kr⟩=0,1,⋯,q−r−1},B={k∈D∣⟨kr⟩=q−r,⋯,q−1}.
When k∈A, ⟨(k+1)r⟩=⟨kr⟩+r, and when k∈B, ⟨(k+1)r⟩=⟨kr⟩+r−q. Thus,
{xk∣k∈A}=p10L−ar⋅{1,a,a2,⋯,aq−r−1} forms a geometric sequence,
{xk∣k∈B}=p10L−ar−q⋅{aq−r,aq−r+1,⋯,aq−1}=paq−r⋅10L−1⋅{1,a,⋯,ar−1}
also forms a geometric sequence. This completes the proof. □