Let $p$ be a prime number. Prove that there exists an integer $a$ such that $p\mid(a^2-a+3)$ if and only if there exists an integer $b$ such that $p\mid(b^2-b+25)$.
I'm getting a bit confused with this problem. I was trying to show first the case $(\Longrightarrow)$ by factoring $a^2-a+3= (a-1)(a-3)+3a$, which would imply that $p\vert(a-1), p\vert(a-3)$ and $p\vert3a$. Looking at the last condition $p\vert3a$ it seems that this would only be true if $p=3$?
Similarly for $(\Longleftarrow)$ the term $b^2-b+25$ factors as $(b-1)(b-25)+25b$ which would imply also that $p\mid(b-1), p\mid t(b-25)$ and $p\mid 25b$.
Is this going anywhere or should I consider something else?