2025 SSMO Relay Round 5 Problems/Problem 1

Problem

The numbers $17$ and $25$ are written on a blackboard. Every second, if the number $n$ is currently written on the blackboard, it is replaced by $3n$ with probability $p$ and by $2n+3$ with probability $1-p$. For example, after one second, the two numbers on the blackboard may be $3\cdot17=51$ and $2\cdot 25+3=53$. Given that the expected positive difference between the two numbers on the blackboard after six seconds is $1000,$ the value of $p$ can be expressed as $\sqrt{a}-b,$ where $a$ and $b$ are positive integers. Find $a+b$.

Solution