Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-337-totient-stairstep-sequences.english.md
Randell Dawson a7eb800450 fix(curriculum): Remove unnecessary assert message argument from English Coding Interview Prep challenges - Project Euler - 04 (#36418)
* fix: removed assert msg argument-4

* fix: remove double quotes surrounding testString code

Co-Authored-By: Tom <20648924+moT01@users.noreply.github.com>
2019-07-27 07:34:19 -05:00

1.0 KiB

id, challengeType, title
id challengeType title
5900f4be1000cf542c50ffd0 5 Problem 337: Totient Stairstep Sequences

Description

Let {a1, a2,..., an} be an integer sequence of length n such that: a1 = 6 for all 1 ≤ i < n : φ(ai) < φ(ai+1) < ai < ai+11 Let S(N) be the number of such sequences with an ≤ N. For example, S(10) = 4: {6}, {6, 8}, {6, 8, 9} and {6, 10}. We can verify that S(100) = 482073668 and S(10 000) mod 108 = 73808307.

Find S(20 000 000) mod 108.

1 φ denotes Euler's totient function.

Instructions

Tests

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

Challenge Seed

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

euler337();

Solution

// solution required