Problem #170
Magical Distance
Consider all points with integral positive coordinate (x,y) which lies on the curve
\left\vert x^2-4xy-y^2 \right\vert=1
Let P_i be the coordinate of i^{th} point when all the points satisfying above equation are sorted in ascending order according to their distance from the origin.
Let D_i = distance between (0,0) and Pi
If S(n) =\sum_{i=1}^{n} Di^2
Enter the value of S(10^{15}) mod 1000000009.