freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-135-same-difference...

1.0 KiB
Raw Blame History

id challengeType title forumTopicId
5900f3f31000cf542c50ff06 5 Problem 135: Same differences 301763

Description

Given the positive integers, x, y, and z, are consecutive terms of an arithmetic progression, the least value of the positive integer, n, for which the equation, x2 y2 z2 = n, has exactly two solutions is n = 27: 342 272 202 = 122 92 62 = 27 It turns out that n = 1155 is the least value which has exactly ten solutions. How many values of n less than one million have exactly ten distinct solutions?

Instructions

Tests

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

Challenge Seed

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

euler135();

Solution

// solution required