Question 12
Let the real numbers $a_1,a_2,a_3,a_4$ and $a_5$ be such that $a_{n+1}=|a_n|-|a_n-1|$ for $1\le n\le4$. If $a_5=\frac12$ and $a_1=\frac pq$, where $p$ and $q$ are relatively prime positive integers, what is the value of $p+q$?
IMAS · IMAS 2013–2014 Junior Division — Round 2