<s>[INST] Let $d$ be any positive integer not equal to $2, 5,$ or $ 13$ , then $\exists a, b \in \{2, 5, 13, d\}$ such that $ab − 1$ is not a perfect square? Let $d$ be any positive integer not equal to $2, 5,$ or $ 13$. Then can we always find
distinct $a, b \in \{2, 5, 13, d\}$ such that $ab − 1$ is not a perfect square ?
 [/INST] This is IMO 1986 Problem 1.
You can find a solution here (or here).
If $d$ is equal to $2,5$ or $13$, then $2d-1$, $5d-1$, $13d-1$ are not perfect squares respectively, so the restriction of $d$ to be neither of $2,5,13$ unnecessarily makes the statement less general.
It works for any integer $d$, even negative or zero.
The latter are trivial cases and so let's assume that $d\ge 1$.
Clearly one of $a,b$ must be $d$, since $2\cdot 13-1=5^2, 2\cdot 5-1=3^2, 5\cdot 13 -1=8^2$, and they can't both be $d$ because the problem says $a,b$ are distinct.
So the problem then becomes - show that at least one of $2d-1, 5d-1, 13d-1$ is not a perfect square.  
Assume the contrary for a contradiction - $2d-1, 5d-1, 13d-1$ are all perfect squares.  
Quadratic residues modulo $16$ are $0,1,4,9$, so it is a necessary condition that all of $2d-1, 5d-1, 13d-1$ are each one of $0,1,4,9$ modulo $16$.  
We'll prove this is not the case and so we'll get a contradiction.
$2d-1\equiv $ one of $0,1,4,9$ modulo $16$ iff $d$ is one of $1,5,9,13$ modulo $16$.  
If $d$ is $1$ or $13$ modulo $16$, then $13d-1\equiv 12$ or $8$ modulo $16$ (respectively), but it must be one of $0,1,4,9$ - impossible.
If $d$ is $5$ or $9$ modulo $16$, then $5d-1\equiv 8$ or $12$ modulo $16$ (respectively), but it must be one of $0,1,4,9$ - impossible.
Contradiction.
</s>