As we have to check divisibility by three numbers , So we can implement bit masking
int [ ] multiple = { 2 , 3 , 5 } ; int count = 0 , mask = ( int ) Math . Pow ( 2 , 3 ) ; for ( int i = 1 ; i < mask ; i ++ ) {