Find the sum of all four digit natural numbers of the form $4AB8$ which are divisible by $2,3,4,6,8$ and $9$
I know that I can ignore the conditions of 2,3,4 and 6 because checking for divisibility by 8 and 9 would be sufficient to satisfy all conditions.
To check for divisibility by 9, I need to make sure that all the digits summed up would be divisible by 9. So $$4+A+B+8\equiv 0 (\textrm{mod} 9)$$ Since $$0\leq A+B\leq 18$$, $$A+B=6$$ or $$A+B=15$$
Now checking for divisibility by 8, I need to make sure that the last 3 digits are divisible by 8. I.e. $$100A+10B+8\equiv 0 (\textrm{mod} 8)$$ This simplifies to $$10A+B\equiv 0 (\textrm{mod}8)$$ Applying the previous equations from the divisibility by 9, I can get that: $$9A\equiv -6 (\textrm{mod} 8)$$ and $$9A\equiv -15 (\textrm{mod}8)$$
This would further simplify to: $$9A\equiv 18 (\textrm{mod} 8)$$ and $$9A\equiv 9 (\textrm{mod}8)$$ which would give me $$A=1,2,9$$ and $$B=5,4,6$$ respectively.
The pairs $(2,4)$ and $(9,6)$ work but $4158$ is not divisible by $8$. I'm not too sure where I went wrong but I'm new to modular arithmetic and any help is appreciated. Thank you!