You have 2 unknowns in that.

If you have only one unknown, you can solve.

Hence, use to write it in terms of "a" only,

thereby solving for "a".

Or use to write it in terms of "n" only,

thereby solving for "n".

Once you've found one, you can find the other.

This is why the problem gave 2 clues.