freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-455-powers-with-trailing-digits.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.0 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f5331000cf542c510046 5 false Problem 455: Powers With Trailing Digits 302129

Description

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:

f(4) = 411728896 (4411728896 = ...490411728896) f(10) = 0 f(157) = 743757 (157743757 = ...567000743757) Σf(n), 2 ≤ n ≤ 103 = 442530011399 Find Σf(n), 2 ≤ n ≤ 106.

Instructions

Tests

tests:
  - text: <code>euler455()</code> should return 450186511399999.
    testString: assert.strictEqual(euler455(), 450186511399999);

Challenge Seed

function euler455() {
  // Good luck!
  return true;
}

euler455();

Solution

// solution required