Let $n$ be a positive integer. Let $S(n)$ be the number of positive square integers less than $n$, e.g.
\begin{bmatrix} n & S(n) \\ \hline 1 & 0 \\ 2& 1 \\ 3& 1 \\ 4& 1 \\ 5 & 2 \\ 6& 2 \\ 7& 2 \\ 8& 2 \\ 9& 2 \\ 10& 3 \\ \end{bmatrix}
Is there a simple formula for $S(n)$ as a function of $n$? I haven't been able to figure it out.
The floor function applied to $\sqrt{n-1}$ :
$$S(n) = \lfloor \sqrt {n-1} \rfloor$$
Explation: $k^2 < n \iff k^2 \leq n-1 \iff k \leq \sqrt{n-1}$.