freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-294-sum-of-digits---experience-23.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
5900f4931000cf542c50ffa5 5 false Problem 294: Sum of digits - experience #23 301946

Description

For a positive integer k, define d(k) as the sum of the digits of k in its usual decimal representation. Thus d(42) = 4+2 = 6.

For a positive integer n, define S(n) as the number of positive integers k < 10n with the following properties : k is divisible by 23 and d(k) = 23.

You are given that S(9) = 263626 and S(42) = 6377168878570056.

Find S(1112) and give your answer mod 109.

Instructions

Tests

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

Challenge Seed

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

euler294();

Solution

// solution required