Add multiples of 3 and 5. Since common multiples are counted twice in n / 3 + n / 15 , subtract common multiples
return ( parseInt ( n / 3 , 10 ) + parseInt ( n / 5 , 10 ) - parseInt ( n / 15 , 10 ) ) ; }