Convergence of $S_n(a) = \sum_{an < k \leqslant (a+1)n} \frac{1}{\sqrt{kn-an^2}}$ Let $a\in\mathbb{R}$ et $n \in\mathbb{N}$,
Denote the following sequence,
$$\displaystyle S_n(a) = \sum_{an < k \leqslant (a+1)n} \frac{1}{\sqrt{kn-an^2}}$$

For which values ​​of $a$ the sequence $(S_n(a))$ converges?

With an Integral test we can prove that $$\sum_{an+1 < k \leq an+n} \frac{1}{\sqrt{kn-an^2}} \to 2$$
However, I don't see how can I continue ?
Thank you in advance.
EDIT: I forgot to say $k$ is an integer. My apology.
 A: I assume that $k$ shall be an integer, otherwise it would be unclear which set it should traverse.
With $j = k - \lfloor an\rfloor$, we have
$$S_n(a) = \sum_{an < k \leqslant (a+1)n} \frac{1}{\sqrt{kn-an^2}} = \sum_{j=1}^n \frac{1}{\sqrt{(\lfloor an\rfloor + j)n - an^2}} = \sum_{j=1}^n \frac{1}{\sqrt{(j-(an-\lfloor an\rfloor))n}}.$$
Let us write $\rho_n(a) = an - \lfloor an\rfloor$. By definition, we have $0 \leqslant \rho_n(a) < 1$.
For the sum without the first term, we have the easy estimates
$$\sum_{j=2}^n \frac{1}{\sqrt{jn}} \leqslant \tilde{S}_n(a) := \sum_{j=2}^n \frac{1}{\sqrt{(j-\rho_n(a))n}} < \sum_{j=2}^n \frac{1}{\sqrt{(j-1)n}}$$
where both outer terms tend to $\int_0^1\frac{dx}{\sqrt{x}} = 2$.
So the convergence of $S_n(a)$ is entirely determined by the behaviour of the first term
$$\frac{1}{\sqrt{(1-\rho_n(a))n}}.$$
If there is a $c > 0$ such that $1-\rho_n(a) \geqslant c$ for all $n$, then the first term is at most $\frac{1}{\sqrt{cn}}$ and tends to $0$, whence in that case $S_n(a) \to 2$. For rational $a$ such a $c > 0$ exists, so $S_n(a)$ converges (to $2$) for all rational $a$.
But for irrational $a$, if we denote the convergents of the continued fraction of $a$ by $\frac{p_m}{q_m}$, we have
$$\left\lvert a - \frac{p_m}{q_m}\right\rvert < \frac{1}{q_m^2}.$$
The convergents with odd indices are all $> a$, thus
$$0 < \frac{p_{2m+1}}{q_{2m+1}} - a < \frac{1}{q_{2m+1}^2} \iff 0 < p_{2m+1} - q_{2m+1}a < \frac{1}{q_{2m+1}},$$
and we see that $\lfloor q_{2m+1} a\rfloor = p_{2m+1}-1$ and
$$1 - \rho_{q_{2m+1}}(a) = 1+\lfloor q_{2m+1}a\rfloor - q_{2m+1}a = p_{2m+1}- q_{2m+1}a,$$
and so
$$0 < (1-\rho_{q_{2m+1}}(a))q_{2m+1} < 1,$$
which means that the first term in $S_n(a)$ is greater than $1$ infinitely often. But for the convergents with even indices, we have
$$0 < \rho_{q_{2m}}(a) = q_{2m}a - p_{2m} < \frac{1}{q_{2m}},$$
and thus $1-\rho_n(a) > \frac{1}{2}$ for infinitely many $n$, so for irrational $a$, we have
$$2 = \liminf_{n\to\infty} S_n(a) < 3 \leqslant \limsup_{n\to\infty} S_n(a).$$
Result:
$S_n(a)$ converges if and only if $a \in\mathbb{Q}$.
A: $k=an+j$, with $j\in\overline{1\ldots n}=>S_n(a)=\displaystyle\sum_{j=1}^n\dfrac1{\sqrt{jn}}=\dfrac1n\cdot\sum_{j=1}^n\dfrac1{\sqrt{\dfrac jn}}$ , which tends to $\displaystyle\int_0^1\frac{dx}{\sqrt x}$ as n tends to infinity, whose value is $2$. See Riemann sum for more details.
