Problem

Source: 2001 Moldova MO Grade 8 P8

Tags: number theory, Diophantine equation



Let $S$ be the set of positive integers $x$ for which there exist positive integers $y$ and $m$ such that $y^2-2^m=x^2$. (a) Find all of the elements of $S$. (b) Find all $x$ such that both $x$ and $x+1$ are in $S$.