On finding $2$ numbers in a set such that one divides the other. Here is the original problem

Let $p > 5$ be a prime number and $$X = \{p - n^2| n \in \mathbb{N}, n^2 < p\}.$$ Prove that $X$ contains two distinct elements $x, y$ such that $x \neq 1$ and $x$ divides $y$.

I found solutions to this but they involved the use of floor function$\lfloor\cdot\rfloor$.
I am very much a beginner to number theory, and I wish solutions that avoid the use of these and modular arithmetic. What I essentially know is theorems in divisibility, and some that relate to primes.
For a special note, one tends to conjecture on the first few observations that $p - (n')^2\ |\ p - 1$, but this fails for $23$, for example, where $n'$ is the greatest value of $n$.
So now, okay, the hope to prove that conjecture is gone, but still I hoped that $p - (n')^2$, would have to do some thing with the proof.
But again, one can see the example for $17$, where $p - (n')^2 = 1$, which is not as what the question asks. ($x \neq 1$)
Now how should I relate the elements in the original set so that one divides the other, I don't know.
I provided what my thoughts were; though I have no idea how to exploit them, or how to create another stream of algebra that says something more about the problem. I provided, from my view, what not works for the problem.
Helping is welcome, and thanks in advance!
 A: For simplicity of notation, let $P$ be the largest integer smaller than or equal to $ \sqrt{p-2}$. This is the only use of the floor function, which you can otherwise ignore by just memorizing the definition of $P$.

We want to find a $n, m$ such that $ p -n^2 \mid p - m^2 $, subject to $ 1 \leq m < n \leq \sqrt{ p - 2 }$, or that $ 1 \leq m < n \leq P$.
Notice that $ p - n^2 \mid p - m^2 \Rightarrow p-n^2 \mid (p-m^2)  - (p-n^2) = n^2-m^2 = (n-m)(n+m)$.
Wishful thinking: It would be very nice if we had $ p-n^2  = n+m$. If so, the divisibility result is immediate.
What can we do to help ensure this could happen? What issues might arise (and can we fix them)?
Firstly, since $n + m < 2P$ is "small", let's aim to make $ p-n^2$ small. What's the smallest it can be?

 With $n = P,$ we get $p - P^2$.

Secondly, if $ p -n^2 < n$, then $m$ will be negative.

 Well, in this case, we have $ p -n^2 = n - m$, so we just need to modify our wishful thinking slightly to $ p - n^2 = n-m$ or $n+m$.

Finally, can we always have $ p - n^2 = n-m$ or $n + m$?

 Since $ 0 < m < P$, the only requirement is that $ 0 < |p - P^2 -P | < P $.

(Fill in the gaps, use the fact that $p>5$ is prime.)
Verify that this holds true unless $ p  = (P+1)^2 + 1 $ for some odd $P \geq 3$.
For this case, setting $ n = P, m = 1$ gives us $ p - P^2 = 2P + 2, p - 1 = P^2 + 2P + 1$, so $ \frac{p-m^2}{p-n^2} = \frac{P+1}{2}$ which is an integer as $P$ is odd, so we are done.
Corollary: $n = P$ always works.

Note

*

*You could have guessed at the conclusion $n=P$ by checking small (but large enough) cases and listing out all of the $(n, m)$ that worked. You came close to this, but didn't properly deal with the $p = k^2+1$ scenario.

*With this guess, it's direct to prove that it works (which likely is similar to the above).

