Two rational numbers $$ (Error compiling LaTeX. Unknown error_msg) and $$ (Error compiling LaTeX. Unknown error_msg) are written on a blackboard, where $$ (Error compiling LaTeX. Unknown error_msg) and $$ (Error compiling LaTeX. Unknown error_msg) are relatively prime positive integers. At any point, Evan may pick two of the numbers $$ (Error compiling LaTeX. Unknown error_msg) and $$ (Error compiling LaTeX. Unknown error_msg) written on the board and write either their arithmetic mean $$ (Error compiling LaTeX. Unknown error_msg) or their harmonic mean $$ (Error compiling LaTeX. Unknown error_msg) on the board as well. Find all pairs $$ (Error compiling LaTeX. Unknown error_msg) such that Evan can write
on the board in finitely many steps.
Proposed by Yannick Yao