I'm trying to find a better method of calculating the sum
$$\sum_{k=1}^N\lceil ak\rceil^2$$
where $a$ is an irrational number. So far, my only idea is to somehow use a best rational approximation. I believe I should be able to calculate at the very least
$$\sum_{k=1}^d\lceil\frac{ck}d\rceil^2$$
where $c$ and $d$ are integers. However, that will leave several values at the end and, in this case, a linear algorithm won't do. Any suggestions?