Note that you have
$$
7^n - 1 = 6a\\
5^n - 1 = 4b
$$
Now we're interested in whether $a$ and $b$ are even or odd. Which is to say we want to know when $7^n - 1$ is divisible by $4$ (so that when you divide it by $6$ you get an even number), and when $5^n-1$ is divisible by $8$ (so that when you divide it by $4$, you get an even number).
The binomial theorem gives
$$
7^n - 1 = (8-1)^n - 1\\
= 8^n - \binom n18^{n-1} + \cdots + (-1)^{n-1}\binom{n}{n-1}8 + (-1)^n - 1
$$
We see that this is divisible by $4$ exactly when $(-1)^n - 1$ is, which is to say when $n$ is even.
Then we have
$$
5^n - 1 = (4 + 1)^n - 1\\
= 4^n + \binom n14^{n-1} + \cdots + \binom{n}{n-1}4 + 1 - 1
$$
and we see that this is divisible by $8$ precisely when $\binom{n}{n-1} = n$ is even.
So $a$ and $b$ are both even for even $n$, and both odd for odd $n$, proving that $a+b$ is always even, meaning $12(a+b)$ is divisible by $24$.