# What is the remainder of Euclidean division of L=111…1 (2018 times) in base 7 by 9 [closed]

What is the remainder of Euclidean division of L=11111...1 (2018 times) in base 7 by 9?

## closed as off-topic by Leucippus, José Carlos Santos, Shailesh, Gibbs, Lee David Chung LinJan 29 at 0:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please provide additional context, which ideally explains why the question is relevant to you and our community. Some forms of context include: background and motivation, relevant definitions, source, possible strategies, your current progress, why the question is interesting or important, etc." – Leucippus, José Carlos Santos, Shailesh, Gibbs, Lee David Chung Lin
If this question can be reworded to fit the rules in the help center, please edit the question.

• @saulspatz in base $7$. $L =\frac{7^{2018} - 1}6$. – fleablood Jan 28 at 20:28
• @fleablood Oops, skipped right over that. – saulspatz Jan 28 at 20:43
• Unfortunately, not very useful in this case, as $6$ does not have an inverse mod $9$ – Jordan Green Jan 28 at 21:48

Note that $$\begin{split}L &= 1+7+7^2+7^3+7^4+7^5+ \dots + 7^{2017} \\ &\equiv (1+7+4)+(1+7+4)+ 7^6+\dots + 7^{2017} \pmod{9}. \end{split}$$ How many full repetitions of the pattern do we have? What is the equivalence class of each leftover term?

$$L = 111......111_7 = \sum_{i=0}^{2017} 7^i$$

By Euler's Th. $$7^6 \equiv 1 \pmod 9$$ and so

Direct observation we can do better: $$7^3\equiv(-2)^3 \equiv -8 \equiv 1 \pmod 9$$

$$1 + 7 + 7^2\equiv 1 -2 + 4 = 3 \pmod 9$$.

So $$L = \sum_{i=0}^{2017} 7^i\equiv \sum_{i=0}^{2017} 7^{i\mod 3} \equiv \sum_{i=0}^{3*672-1+2} 7^{i\mod 3}$$

$$\equiv \sum_{k=1}^{672} (7^0 + 7^1 + 7^2) + 7^0 + 7^1\equiv \sum_{k=1}^{672}3 + 8 \equiv 672(3) +8\equiv 8 \pmod 9$$.

The remainder is $$8$$

• How is $3$ times something plus $8$ a multiple of $3$? Also I thought $2016/3$ was $672$. – Oscar Lanzi Jan 28 at 21:35
• Good point! But $2016/6 = 336$ and $336 * 2= 772$ as everyone can do in their heads and not deign to use calculators knows.... I made arithmetic mistakes. A lot. I'll try to fix them. – fleablood Jan 28 at 22:29
• Likewise everyone knows $3+8 = 11 \equiv 3 \mod 9$ because $9 + 3 = 11$. Duh! I mean.... that's obvious, right? – fleablood Jan 28 at 22:35
• +1 for the sense of humor. Always good to have a proofreader. – Oscar Lanzi Jan 28 at 23:49