Problem

Source: China Northern Mathematical Olympiad

Tags: number theory, sum of digits



Let \(S(n)\) denote the sum of the digits of the base-10 representation of an natural number \(n\). For example. \(S(2017) = 2+0+1+7 = 10\). Prove that for all primes \(p\), there exists infinitely many \(n\) which satisfy \(S(n) \equiv n \mod p\).