freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-210-obtuse-angled-triangles.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.0 KiB
Raw Blame History

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f43e1000cf542c50ff50 5 false Problem 210: Obtuse Angled Triangles 301852

Description

Consider the set S(r) of points (x,y) with integer coordinates satisfying |x| + |y| ≤ r. Let O be the point (0,0) and C the point (r/4,r/4). Let N(r) be the number of points B in S(r), so that the triangle OBC has an obtuse angle, i.e. the largest angle α satisfies 90°<α<180°. So, for example, N(4)=24 and N(8)=100.

What is N(1,000,000,000)?

Instructions

Tests

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

Challenge Seed

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

euler210();

Solution

// solution required