The
th number in the sequence can be expressed as
![a_n=10^(n+1)+\displaystyle2\sum_(i=2)^n10^i+21](https://img.qammunity.org/2020/formulas/mathematics/college/ncv4srdouufha1rl6uq7vit4newehdtkgv.png)
Extracting the
th term from the sum gives
![a_n=10^(n+1)+2\cdot10^n+\displaystyle2\sum_(i=2)^(n-1)10^i+21](https://img.qammunity.org/2020/formulas/mathematics/college/3x3j95xulhugmzljpgclmj0vtwpz60basj.png)
and
. 3 divides both 12 and 21, so
and 21 contribute no remainder.
This leaves us with
![a_n\equiv10\cdot\underbrace{222\ldots222}_{n-2\text{ copies}}\pmod3](https://img.qammunity.org/2020/formulas/mathematics/college/eigikofj7xg7dn2rgzmrk04w2kss8yptvk.png)
Recall that a decimal integer is divisible by 3 if its digits add to a multiple of 3. The digits in
are
copies of 2 and one 0, so the digital sum is
.
- If
for
, then the digital sum is
, which is not divisible by 3. - If
, then the sum is
, which is not divisible by 3. - If
, then the sum is
, which is always divisble by 3.
This means that roughly 1/3 of the first
numbers in this sequence are divisible by 3; among the first 100 terms, they occur for
, of which there are 33.