The very first problem on Project Euler states:
If we list all the natural numbers below $10$ that are multiples of $3$ or $5$, we get $3, 5, 6$ and $9$. The sum of these multiples is $23$. Find the sum of all the multiples of $3$ or $5$ below $1000$.
Of course the answer is $233168$, and fortunately the solution is even on MSE. However, things got interesting when I increased the limit to $10^n$ instead of $1000$, for different values of $n$. It seems the sum's digits obey the formula $2333\dots(n \text{ times})1666...(n-1 \text{ times})8$, for large $n$. Similarly, for the sum of all multiples of $2$ or $3$ the formula is $333...(n \text{ times})1666...(n-2 \text{ times})7$. And for the sum of all multiples of $2$ or $5$ the formula is $2999...(n-1 \text{ times})5000...(n-1 \text{ times})$. Now the fun thing is that this behavior ($P.1$) is not shown by any other pair of primes. Rather they have another unique property ($P.2$), when $n$ is large. Like for $7$ and $13$ the first $6$ digits from left are always $104395...$, for $19$ and $5$ the first $5$ digits from left are always $12105...$, and so on. Furthermore, these patterns aren't observed when I take a base different from $10$, like say, $16$. This implies the said patterns have something to do with the base of our numeral system being $10$. But then, even in base $16$ numeral system, only the pairs between $2, 3, 5$ show the property $P.1$ for sums under $16^n$. So the said properties must belong to the primes themselves? I'm sorry my approach is empirical, but I would be obliged if you could show me the formal approach to this, maybe number theory or linear algebra. Thank you!
Sum of all numbers which are divisible by a number follow an arithmetic progression. Formula for an arithmetic progression :
$$\frac{(a_1+a_n)n}{2}$$ Sum of first and last number multiplied by number of numbers divided by two.
Therefore we can make the following approximation, sum of two arithmetic progressions like so:
Divisible by $3$ will be all the numbers on average $10/3$ for every $10$. By $5$ the corresponding frequency will be $10/5=2$
$(10/3)\cdot 10^k/2 + 10^k = (8/3)\cdot10^k$
This number $8/3$ expands decimally as $2.666...$
We then need to subtract the overlap which following a similar reasoning will be $10/15/2 = 1/3$ which takes us to $2.3333$.
Now we have a basis for investigating more advanced cases. The quotients will be different for other primes but it will still boil down to linear combinations of fractions involving 10 and primes.
What you will see is the numbers in the decimal expansion of $(5/p_1)+(5/p_2)-(5/(p_1p_2))$ That one of the p:s here is $5$ may play a role as $5/5 = 1.00000...$ will give $0$ contribution to the tail of numbers in the decimal part. This is due to the numbers 10 and 5 not being relatively prime.
The decimal expansion of a fraction $10/k$ for a natural number $k$ can be as a sequence of moduli.
Take example $10/7$ gives 3 remainder
Multiply with 10 : 30, $28=4\cdot 7$, gives 2 remainder
And so on.
We will get a loop among the remainders in the set $\{1,\cdots p-1\}$. The length of this loop can vary. For $10$ and $3$ apparently it is only $1$, but for $10$ and $7$ it is $6$.
$11$ and $3$ are "friends" with respect to $10$ in the sense that $11\cdot 9 =99=100-1$ and $3\cdot 3=9=10-1$ will cause similar loops but of different length.
One can expand on this without limit, but I think this suffices to answer the question?