# Closed-form for Floor Sum 4

Consider the following expression:

$$\sum_{k=0}^{\frac{N-1}{2}} \left\lceil\sqrt{k^2+N}\right\rceil - \sum_{k=0}^{\frac{N-1}{2}}\left\lfloor\sqrt{k^2+N}\right\rfloor - 1 = \frac{N-1}{2} - C$$

$C$ in this case is the amount of times a positive odd integer $N$ can be expressed as the product of two positive integers.

If the factorization of $N$ is known, and as a consequence $C$, we know for which $k$, $k^2 + N$ will be square numbers.

Assume we know the factorization of $N$ and we know $C$ for a given $N$, is it possible to find closed-forms for the two sums?

Take $7129$ for example. It is a prime number, so the sum will be equal to $$\frac{7129-1}{2} - 1 = 3563$$ I am interested in the contribution of both sums.

Thanks

• $C$ is not an integer if $N$ is even. – Robert Israel Aug 28 '17 at 19:35
• Yes, sorry, I updated the description, the expression is meant for positive odd integer $N$ – Ruan Sunkel Aug 28 '17 at 19:37
• Fixed a few errors – Ruan Sunkel Aug 28 '17 at 20:06