Function to return the smallest prime number with d digits
static int smallestPrime ( int d ) { int l = ( int ) Math . Pow ( 10 , d - 1 ) ; int r = ( int ) Math . Pow ( 10 , d ) - 1 ; for ( int i = l ; i <= r ; i ++ ) {