Let $p\in(0,1)$ and $n$ be a finite positive integer. How to compute the following sum \begin{equation} \frac{1}{(\frac{1}{n}-p)^{2}}+\frac{1}{(\frac{2}{n}-p)^{2}}+\ldots+\frac{1}{(\frac{n-1}{n}-p)^{2}}+\frac{1}{(1-p)^{2}}? \end{equation}
I tried substitution and expanding the denominator terms, but it doesn't seem to work. Any hints?
Edit $1$:
So here is why I want to compute this sum. Let $Z\sim\text{Bin}(n,p)$. I want to compute $\mathbb{E}|\frac{Z}{n}-p|$. Since $U:=|\frac{Z}{n}-p|$ is a non negative random variable taking values in $A:=\{p,|\frac{1}{n}-p|,\ldots,1-p\}$, I have \begin{align} \mathbb{E}|\frac{Z}{n}-p|&=\sum_{t\in A}\mathbb{P}(U>t)\\ &\le \text{var}(U)\sum_{t\in A}\frac{1}{t^{2}}\quad (\text{Chebyshev's inequality}) \end{align} This summation is what appears above. Another way could be to use an exponential bound in the second step.
Edit $2$
So a simple upper bound is the following: \begin{align} \mathbb{E}|\frac{Z}{n}-p|&\le \frac{1}{n}\sqrt{\mathbb{E}(Z-np)^{2}}\\ &=\frac{\sqrt{p(1-p)}}{\sqrt{n}}, \end{align} which would be okay for my calculation.
Any techniques to compute the sum in question are still welcome.
Denote by $\lfloor{x}\rfloor$ the largest integer smaller than $x$. It seems to me that your expectation can be computed exactly without too much effort: $$ \sum_{k=0}^n {n\choose k}p^k (1-p)^{n-k}\Big|\frac{k}{n}-p\Big|=\frac{1}{n}\left[\sum_{k=\lfloor{np}\rfloor+1}^n {n\choose k}p^k (1-p)^{n-k}(k-np)+\sum_{k=0}^{\lfloor{np}\rfloor} {n\choose k}p^k (1-p)^{n-k}(np-k)\right] $$ $$ =\boxed{\frac{2 (\lfloor{np}\rfloor+1) p^{\lfloor{np}\rfloor+1} \binom{n}{\lfloor{np}\rfloor+1} (1-p)^{n-\lfloor{np}\rfloor}}{n}}\ . $$