<p>
E<sub><var>a</var></sub> is an ellipse with an equation of the form x<sup>2</sup> + 4y<sup>2</sup> = 4<var>a</var><sup>2</sup>.<br />
E<sub><var>a</var></sub>' is the rotated image of E<sub><var>a</var></sub> by θ degrees counterclockwise around the origin O(0, 0) for 0° < θ < 90°.
</p>
<div align="center">
<img src="https://projecteuler.net/project/images/p404_c_ellipse.gif" alt="p404_c_ellipse.gif" /></div>
<p>
<var>b</var> is the distance to the origin of the two intersection points closest to the origin and <var>c</var> is the distance of the two other intersection points.<br />
We call an ordered triplet (<var>a</var>, <var>b</var>, <var>c</var>) a <i>canonical ellipsoidal triplet</i> if <var>a</var>, <var>b</var> and <var>c</var> are positive integers.<br />
For example, (209, 247, 286) is a canonical ellipsoidal triplet.
</p>
<p>
Let C(<var>N</var>) be the number of distinct canonical ellipsoidal triplets (<var>a</var>, <var>b</var>, <var>c</var>) for <var>a</var> ≤ <var>N</var>.<br />
It can be verified that C(10<sup>3</sup>) = 7, C(10<sup>4</sup>) = 106 and C(10<sup>6</sup>) = 11845.
</p>
<p>
Find C(10<sup>17</sup>).
</p>