I would write the equality as:

\(\displaystyle n=2a+5b\)

When *n* is even, i.e., \(\displaystyle n=2m_1\) where \(\displaystyle 2\le m_1\in\mathbb Z\) let b also be even, i.e., \(\displaystyle b=2m_2\) where \(\displaystyle 0\le m_2\in\mathbb Z\) so that you have:

\(\displaystyle 2m_1=2a+5\(2m_2\)=2\(a+5m_2\)\)

\(\displaystyle m_1=a+5m_2\)

\(\displaystyle 0\le a=m_1-5m_2\)

\(\displaystyle 5m_2\le m_1\)

We see this is always possible.

When *n* is odd, i.e., \(\displaystyle n=2m_1+1\) where \(\displaystyle 2\le m_1\in\mathbb Z\) let b also be odd, i.e., \(\displaystyle b=2m_2+1\) where \(\displaystyle 0\le m_2\in\mathbb Z\) so that you have:

\(\displaystyle 2m_1+1=2a+5\(2m_2+1\)=2\(a+5m_2\)+5\)

\(\displaystyle m_1=a+5m_2+2\)

\(\displaystyle 0\le a=m_1-5m_2-2\)

\(\displaystyle 5m_2+2\le m_1\)

We see this is always possible.