Artificial intelligent assistant

A cashier has only pennies, nickels, and quarters. A cashier has only pennies, nickels, and quarters. When I asked him to break a $1 bill he gave me 25 coins. Do you think the cashier made a counting mistake? So I can solve this problem just by listing out the possible combinations. The cashier did make a mistake, but short of listing all the outcomes, I can't think of a way to know for sure. I'm just wondering if there is a more elegant solution. Maybe something with parity.

Let $p,n,q$ be the number of pennies, nickels, and quarters. Then we want $$p+n+q=25\quad\&\quad p+5n+25q=100$$ Subtracting the first from the second shows that $4n+24q=75$. But the left hand is even and the right hand is odd.

If you are used to modular arithmetic, you can just work $\pmod 2$ in which case the first equation reads $p+n+q\equiv 1$ and the second reads $p+n+q\equiv 0$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6ff76fd67b8372f38db92181b26a3666