Example 2 Let $n \in \mathbf{N}^{*}$, consider the region in the coordinate plane bounded by the inequalities $y>0, 0<x \leqslant n, y \leqslant$ $\sqrt{x}$. Try to express the number of integer points within this region using $n$ and $a(=[\sqrt{n}])$.
From property 6, we know that the number of integer points in the region sought in the problem is
$$T=\sum_{k=1}^{n}[\sqrt{k}]$$

We use the following method to calculate $T$.
For a proposition $P$, we introduce the notation $[P]$: if $P$ holds, then $[P]=1$; if $P$ does not hold, then $[P]=0$. Thus, we have
$$\begin{aligned}
\sum_{k=1}^{n}[\sqrt{k}] & =\sum_{k=1}^{n} \sum_{j=1}^{a}\left[j^{2} \leqslant k\right] \\
& =\sum_{j=1}^{a} \sum_{k=1}^{n}\left[j^{2} \leqslant k\right] \\
& =\sum_{j=1}^{a}\left(n-j^{2}+1\right) \\
& =(n+1) a-\frac{1}{6} a(a+1)(2 a+1)
\end{aligned}$$