Assume $C$ and $D$ are randomly chosen from $\{1,2, \cdots, n\}$. Let $p_{n}$ be the probability that $C+D$ is perfect square. Compute $$\lim\limits _{n \to \infty}\left(\sqrt{n} p_{n}\right)$$
My Approach: My assumptions were that $C,D$ can be equal and the order of $C,D$ are not considered [I don't know I assumed correct, but in the question it was not clear.]
The number of ways a number $k$ can be partitioned into $2$ parts is equal to $\Big\lfloor\frac{k}{2}\Big\rfloor$ Now with the numbers $\{1,2, \cdots, n\}$ all the numbers from $2$ to $2 n$ can be made by choosing $2$ numbers and adding them up. So number of perfect squares in this region are $\big\lfloor\sqrt{2 n}\big\rfloor-1$ ($-1$ because we cannot make $1$). So the probability of choosing $C, D$ such that $C+D$ is a perfect square is $$p_n= \frac{\displaystyle{\sum_{k=2}^{\big\lfloor\sqrt{2 n}\big\rfloor} \Bigg\lfloor\frac{k^{2}}{2}\Bigg\rfloor}}{n^{2}} $$
Now I cant progress further.
Tell me if I am correct. Also are my assumptions correct ?
Edit: The answer of the limit is $\frac{4(\sqrt{2}-1)}{3}$
$C$ and $D$ are chosen independently, so the number of pairs $(C,D)\in[n]^2$ with $C+D=k^2$ is $$ \begin{cases} k^2-1 &\text{if }2\leq k\leq \sqrt{n+1}\\ 2n+1-k^2& \text{if }\sqrt{n+1}<k\leq\sqrt{2n}\\ 0 & \text{otherwise} \end{cases} $$ So \begin{align*} \sqrt{n}p_n&=\frac{\displaystyle \sum_{k=2}^{\lfloor\sqrt{n+1}\rfloor} (k^2-1)+\sum_{k=\lfloor\sqrt{n+1}+1\rfloor}^{\lfloor\sqrt{2n}\rfloor}(2n+1-k^2)}{n^{3/2}}\\ &\sim n^{-3/2} \sum_{k=2}^{\lfloor\sqrt{n}\rfloor} k^2+n^{-3/2}\sum_{k=\lfloor\sqrt{n}\rfloor}^{\lfloor\sqrt{2n}\rfloor}(2n-k^2)\\ &\sim\int_0^1 x^2\,\mathrm{d}x+\int_1^{\sqrt{2}}(2-x^2)\,\mathrm{d}x=\frac43(\sqrt{2}-1) \end{align*}