Start of the iterator ( Smallest multiple of n )
int start = ( int ) Math . Pow ( 10 , minDigit ) - ( int ) Math . Pow ( 10 , minDigit ) % n ; while ( start < int . MaxValue ) { if ( digitSum ( start ) == m ) return start ; else start += n ; } return - 1 ; }