@belliot
actually the numbers divisible by both a,b=numbers divisible by Least common multiple of(a,b).
for example,numbers divisible by 2={2,4,6,8,10,12,14,16,18,20,22,24,26,28......}
and numbers divisible by 4={4,8,12,16,20,24,28....}.
Now the numbers divisible by both 2,4
=intersection of {2,4,6,8,10,12,14,16,18,20,22,24,26,28......} and {4,8,12,16,20,24,28....}.
={4,8,12,16,20..}
=Numbers divisible by 4
=numbers divisible by l.c.m of 2,4
But if the numbers a,b are co prime, their l.c.m is nothing but their product i.e., a*b.
Here 2,3 are co prime so their l.c.m is 2*3=6. same thing applies for 2,5 and 3,5.
Hope this clarifies your doubt..
@Arjun sir ,i think it is better to add this point.