Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-455-powers-with-trailing-digits.md
gikf a2b2ef3f75 fix(curriculum): clean-up Project Euler 441-460 (#43068)
* fix: clean-up Project Euler 441-460

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-07-30 08:20:31 -07:00

1.0 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f5331000cf542c510046 Problem 455: Powers With Trailing Digits 5 302129 problem-455-powers-with-trailing-digits

--description--

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:

$$\begin{align} & f(4) = 411\,728\,896 (4^{411\,728\,896} = ...490\underline{411728896}) \\ & f(10) = 0 \\ & f(157) = 743\,757 (157^{743\,757} = ...567\underline{000743757}) \\ & Σf(n), 2 ≤ n ≤ 103 = 442\,530\,011\,399 \end{align}$$

Find \sum f(n), 2 ≤ n ≤ {10}^6.

--hints--

powersWithTrailingDigits() should return 450186511399999.

assert.strictEqual(powersWithTrailingDigits(), 450186511399999);

--seed--

--seed-contents--

function powersWithTrailingDigits() {

  return true;
}

powersWithTrailingDigits();

--solutions--

// solution required