P455
projecteuler.net

Powers with Trailing Digits

ℹ️Published on Saturday, 18th January 2014, 10:00 pm; Solved by 803;
Difficulty rating: 40%

Let $f(n)$ be the largest positive integer $x$ less than $10^9$ such that the last $9$ digits of $n^x$ form the number $x$ (including leading zeros), or zero if no such integer exists.

For example:

  • $f(4) = 411728896$ ($4^{411728896} = \cdots 490\underline{411728896}$)
  • $f(10) = 0$
  • $f(157) = 743757$ ($157^{743757} = \cdots 567\underline{000743757}$)
  • $\sum_{2 \le n \le 10^3} f(n) = 442530011399$

Find $\sum_{2 \le n \le 10^6}f(n)$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.