# Calculate the sum with floor function.

Let $$a$$ be a positive number. Calculate the sum $$\sum_{1\le n\le x}\left\lfloor \sqrt{n^{2}+a} \right\rfloor$$

I tried to calculate first $$\left\lfloor \sqrt{n^{2}+a} \right\rfloor-n$$. But probably it won't help. Maybe you have some ideas how to solve it?