Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-479-roots-on-the-rise.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
5900f54b1000cf542c51005d 5 false Problem 479: Roots on the Rise 302156

Description

Let ak, bk, and ck represent the three solutions (real or complex numbers) to the expression 1/x = (k/x)2(k+x2) - kx.

For instance, for k = 5, we see that {a5, b5, c5} is approximately {5.727244, -0.363622+2.057397i, -0.363622-2.057397i}.

Let S(n) = Σ (ak+bk)p(bk+ck)p(ck+ak)p for all integers p, k such that 1 ≤ p, k ≤ n.

Interestingly, S(n) is always an integer. For example, S(4) = 51160.

Find S(106) modulo 1 000 000 007.

Instructions

Tests

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

Challenge Seed

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

euler479();

Solution

// solution required