text: Smallest N digit number divisible by all possible prime digits | C ++ implementation of the above approach ; Function to find the minimum number of n digits divisible by all prime digits ; Driver Code
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; void minNum ( int n ) { if ( n < 3 ) cout << -1 ; else cout << ( 210 * ( ( int ) ( pow ( 10 , n - 1 ) / 210 ) + 1 ) ) ; } int main ( ) { int n = 5 ; minNum ( n ) ; return 0 ; }