TITLE: Compute the last 1000 digits of $1 + 50 + 50^2 + 50^3 + ... + 50^{999}$
QUESTION [5 upvotes]: What is a good way to find the last 1000 digits of:
$ 1 + 50 + 50^2 + 50^3 + ... + 50^{999} $
Or more generally, the last n digits of
$ \sum_{k=0}^{n-1} 50^k $

REPLY [4 votes]: $\newcommand{\d}[1]{\underline{\mathrm{\large{#1}}}}$
$\color{red}{\d{Introduction}}$
As Daniel above guesses, the last $n$ digits of the number $$
1 + 50 + ... + 50^{n-1}
$$
has something to do with the expansion of $\frac 1{49}$. Here's how you get it.
$\color{blue}{\d{On\ the \ expansion\ of\ \frac 1{49}}}$
Well, first we note that $\frac{10^{42}-1}{49}$ is an integer, and for no $0<k<42$ is $\frac{10^k-1}{49}$ an integer. This is the same as saying that the repetend at the end of $\frac 1{49}$ is of length $42$.
This is a standard thing that can be checked, but to make it easier : we know that $\phi(49) = 42$ where $\phi$ is the Euler totient function. Therefore, by Euler's theorem , $49$ always divides $10^{42}-1$. However, it is easy to prove (probably from group theory) that if $10^k-1$ divides $49$ for $k<42$ then $k$ must divide $42$. Therefore, it is sufficient to check for $k$ divisors of $42$. In fact, it's enough to check that each of $10^{6}-1, 10^{14}-1$ and $10^{21}-1$ are not multiples of $49$, which one can show by using the iterative procedure coming from the identity $10^{k+1} \equiv 10 (10^k) \pmod{49}$. (so you don't need to do long division)
$\color{green}{\d{Formula\ for\ the\ last\ n \ digits}}$
Now, we note that if $n \leq 42$ then :
$$
10^{42} \equiv 50^n \pmod{10^n}
$$
therefore elementary transformations lead to :
$$
\frac{10^{42}-1}{49} \equiv \frac{50^n-1}{49} \pmod{10^n}
$$
which works because $49$ is coprime to $10^n$ and because both sides of the $\equiv$ are integers. Therefore, the last $n$ digits of $\frac{50^n-1}{49}$ equal the last $n$ digits of $\frac{10^{42}-1}{49}$, or the last $n$ digits in the repetend of $\frac 1{49}$ when expressed as a decimal.
Now, if $n> 42$, write $n = 42q+r$ where $q>0$. We note that $\frac{10^{42(q+1)}-1}{49}$ is an integer. Therefore, beginning from $$
10^{42(q+1)} \equiv 50^n \pmod{10^n}
$$
we get :
$$
\frac{10^{42(q+1)} - 1}{49} \equiv \frac{50^n-1}{49} \pmod{10^n}
$$
However, note that $\frac{10^{42(q+1)-1}}{49}$ can be retrieved as follows : you take the repetend of $\frac{1}{49}$ , a total of $q$ times. Then to the front of this you attach the last $r$ digits of the same repetend. You are done.
$\color{fuchsia}{\d{Examples}}$
Let's take some examples to show how easy this is. The expansion of $\frac 1{49}$ is :
$$
\frac 1{49} = 0.\overline{020408163265306122448979591836734693877551}
$$
(The expansion can be done using long division, but I'll mention it : There's a Vedic sutra that can be used to calculate reciprocals faster. It is explained briefly on this page. Also note how the start has powers of $2$ : this pattern is quite easy to write down as well, but isn't efficient)
Let $S_n = 1+50 + 50^2 + ...+50^{n-1}$.

The last $13$ digits of $S_{13}$ are the last $13$ digits of the repetend i.e. $6734693877551$.

The last $34$ digits of $S_{34}$ are the last $34$ digits of the repetend i.e. $3265306122448979591836734693877551$.

The last $47$ digits of $S_{47}$ : we have $47 = 42 \times 1 + 5$, so take the repetend once and add the last five digits of the repetend in front :
$$
77551020408163265306122448979591836734693877551
$$

The last $100$ digits of $S_{100}$ : we have $100 = 42 \times 2 + 16$, so take the repetend twice and add the last $16$ digits of the repetend in front :
$$
1836734693877551020408163265306122448979591836734693877551020408163265306122448979591836734693877551
$$


and so on.