Problem

Source: Serbia additional TST 2016

Tags: number theory



Let $w(x)$ be largest odd divisor of $x$. Let $a,b$ be natural numbers such that $(a,b)=1$ and $a+w(b+1)$ and $b+w(a+1)$ are powers of two. Prove that $a+1$ and $b+1$ are powers of two.