Problem 454

Powers With Trailing Digits

Problem 456

Powers With Trailing Digits

Problem 455

Let f(n) be the largest positive integer x less than 109 such that the last 9 digits of nx form the number x (including leading zeros), or zero if no such integer exists.
For example:
Find  f(n), 2 ≤ n ≤ 106.