Project Euler Problem 805
For a positive integer n, let s(n) be the integer obtained by shifting the leftmost digit of the decimal representation
Solution
Answer: 119719335
I derived an efficient number-theoretic formulation and verified it against the example:
- $N(3)=142857$
- $N(\tfrac1{10})=10$
- $N(2)=0$
and confirmed the sample value:
$$T(3)\equiv 262429173 \pmod{1{,}000{,}000{,}007}$$
which matches the problem statement exactly.
Using the same method for all coprime ordered pairs $(u,v)$ with $1\le u,v\le 200$, computing $N(u^3/v^3)$ and summing modulo $1{,}000{,}000{,}007$, gives:
Answer: 119719335