Consider the the sequence $S_n=\sum_{k=0}^n k!$. Note that for any base $b$, as $k$ increases, the base-$b$ expansion of $k!$ will have a monotonically increasing number of right-most zeroes. Hence, the right-most digits of $S_n$ converge as $n\to\infty$.
Take for example the following table of $n$ and the 10 right-most digits of $S_n$ in binary.
n -> right-most 10 digits of S_n
================
0 -> 1
1 -> 10
2 -> 100
3 -> 1010
4 -> 100010
5 -> 10011010
6 -> 1101101010
7 -> 1100011010
8 -> 0010011010
9 -> 1000011010
10 -> 0100011010
11 -> 1000011010
12 -> 1000011010
13 -> 1000011010
Evidently, the right-most 10 digits converge to $1000011010$. This can be shown easily by proving that $k!>2^9$ for all $k>11$.
Regardless, I'd like to calculate an arbitrary amount of these converging right-most digits (particularly in binary). However, as you know, the factorials grow extremely rapidly, blowing past 32 or even 64 bits very quickly, so directly computing the sum of factorials to ridiculous precision in a timely manner is out of the question. Hence, perhaps this is more of a computer-science question, but what are some mathematical optimizations I can make to calculate these digits without having to calculate each factorial?
In other words, how would I find the right-most digits of $S_n$ for very large values of $n$? I imagine modular arithmetic may come in handy, although I'm not sure how.