yaworsw/euler-manager

View on GitHub
data/problems/184.yml

Summary

Maintainability
Test Coverage
---
:id: 184
:name: Triangles containing the origin
:url: https://projecteuler.net/problem=184
:content: |+
  Consider the set <var>I<sub>r</sub></var> of points (<var>x</var>,<var>y</var>) with integer co-ordinates in the interior of the circle with radius <var>r</var>, centered at the origin, i.e. <var>x</var><sup>2</sup> + <var>y</var><sup>2</sup> \< <var>r</var><sup>2</sup>.

  For a radius of 2, <var>I</var><sub>2</sub> contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in <var>I</var><sub>2</sub> which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.

  ![]({{ images_dir }}/p184.gif)

  For a radius of 3, there are 360 triangles containing the origin in the interior and having all vertices in <var>I</var><sub>3</sub> and for <var>I</var><sub>5</sub> the number is 10600.

  How many triangles are there containing the origin in the interior and having all three vertices in <var>I</var><sub>105</sub>?