A repdigit is a positive integer whose base- expansion repeats one nonzero digit . For , and , the finite geometric series gives . For example, has decimal digits, all equal to five.
Every prime number not dividing divides infinitely many such repdigits. If it divides , every length works. Otherwise, if it does not divide , the Fermat little theorem gives divisibility for lengths that are multiples of , and division by is justified by its modular inverse. If , the sum is congruent to modulo , so lengths divisible by work instead. A prime dividing but not divides none, since . This distinction prevents invalid cancellation of the geometric-sum denominator.

Articles by others on the same topic (1)