How can I count the number of numbers divisible by both 5 and 6?
For example let's take only tree-digit numbers, how many of them are divisible by both 5 and 6?
I know how to do it just for 5 or just for 6, using the arithmetic sequence
an = a1 + (n-1)*d
So for just for 5:
995 = 100 + (n-1)*5 n = 180
And just for 6:
996 = 102 + (n-1)*6 n = 150
But how can I count the numbers divisible by both 5 and 6? I know that the answer is 30, but I don't know how to calculate it.