Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-441-the-inverse-summation-of-coprime-couples.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.1 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f5261000cf542c510038 5 false Problem 441: The inverse summation of coprime couples 302113

Description

For an integer M, we define R(M) as the sum of 1/(p·q) for all the integer pairs p and q which satisfy all of these conditions:

1 ≤ p < q ≤ M p + q ≥ M p and q are coprime.

We also define S(N) as the sum of R(i) for 2 ≤ i ≤ N. We can verify that S(2) = R(2) = 1/2, S(10) ≈ 6.9147 and S(100) ≈ 58.2962.

Find S(107). Give your answer rounded to four decimal places.

Instructions

Tests

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

Challenge Seed

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

euler441();

Solution

// solution required