freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-292-pythagorean-polygons.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.2 KiB
Raw Blame History

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f4911000cf542c50ffa3 5 false Problem 292: Pythagorean Polygons 301944

Description

We shall define a pythagorean polygon to be a convex polygon with the following properties:there are at least three vertices, no three vertices are aligned, each vertex has integer coordinates, each edge has integer length.For a given integer n, define P(n) as the number of distinct pythagorean polygons for which the perimeter is ≤n. Pythagorean polygons should be considered distinct as long as none is a translation of another.

You are given that P(4)=1, P(30)=3655 and P(60)=891045. Find P(120).

Instructions

Tests

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

Challenge Seed

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

euler292();

Solution

// solution required