TITLE: find the possible pairs of $~(x,y)~$ such that $~x,y~$ are natural numbers and $x^2=1+4y.$
QUESTION [2 upvotes]: Let $ x,~y~$  are two natural numbers such that $~x,~y \in (0,1001)~$ and also satisfying $~x^2=1+4y.$ Then how many ordered pair of such $~(x,y)~ $ are possible?
First notice that , $x$ is odd natural number, so there exists a positive integer $n$ such that $~x=2n+1.$
Then we have $~y=n^2+n.$
From here how can I find the possible pairs of $~(x,y)~$ such that $~x,y~$ are natural numbers and $x^2=1+4y.$
Please help me to solve this.

REPLY [3 votes]: $$
q = \frac{p^2 - 1}{4} < 1001 \implies p^2 < 4005 \implies p \le 63.
$$
$$
p = 2n+1 \le 63 \implies n \le 31.
$$
It's easy to see that all pairs $\big(2n+1,n(n+1)\big)$ satisfy the equation and constrains for $\,n = 1, \ldots 31$.
{"set_name": "stack_exchange", "score": 2, "question_id": 4164664}