0
$\begingroup$

Let $a \in \mathbb{N}$ be the offset in $a_x = (x^2 + a)_{x \geqslant 0}$ and $b \in \mathbb{N}$ the offset in $b_y = (y^2 + b)_{y \geqslant 0}$

What would be the fastest/or best approach to find the intersections ($a_x = b_y$) for those sequences?

Thank you! :)

1 Answers 1

2

$x^2 + a = y^2 + b$ means $a-b = y^2 - x^2 = (y+x)(y-x)$. So, given $a$ and $b$ (assuming they are not huge), you might start by factoring $a - b$. Each pair of factors with the same parity yield an $x$ and $y$, and thus a member of the intersection.