Problem

Source: 2020 Taiwan APMO Preliminary

Tags: algebra, number theory



Let $(a,b)=(a_n,a_{n+1}),\forall n\in\mathbb{N}$ all be positive interger solutions that satisfies $$1\leq a\leq b$$and $$\dfrac{a^2+b^2+a+b+1}{ab}\in\mathbb{N}$$And the value of $a_n$ is only determined by the following recurrence relation:$ a_{n+2} = pa_{n+1} + qa_n + r$ Find $(p,q,r)$.