For how many integer values of between 1 and 474 inclusive does the decimal representation of \(n/30\) terminate?
The link provided below has a correct answer, but the answerer didn't explain why it only works if it is divisible by 3.
First off, if you have a fraction n/2, then you can have any n in order to repeat
If you have a fraction n/3, then we need a multiple of 3
if we have a fraction n/5, then you can have any n
so we need a multiple of 3 in order to repeat
thus, the answer is 474/3 (if its divisible) or ceil(474/3) (if it's not divisible.)
it's divisible, so the answer is 474/3=158