Given a non-square integer , any real can be approximated arbitrarily close by quadratic integers, where are integers. For example, the following inequalities approximate with precision :
We call the quadratic integer closest to with the absolute values of not exceeding . We also define the integral part of a quadratic integer as .
You are given that:
Find the sum of for all non-square positive integers less than 100.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.