Set the 0 th row of the matrix with c primes from 0 , 0 to 0 , c - 1
static void set_primes ( Dictionary < int , Dictionary < int , int > > mp , Dictionary < int , Dictionary < int , int > > hash , int c ) { int count = 0 ; for ( int i = 2 ; count < c ; i ++ ) { if ( is_Prime ( i ) ) { if ( ! mp . ContainsKey ( 0 ) ) { mp [ 0 ] = new Dictionary < int , int > ( ) ; } if ( ! mp [ 0 ] . ContainsKey ( count ) ) { mp [ 0 ] . Add ( count , i ) ; } else { mp [ 0 ] [ count ] = i ; } count ++ ; if ( ! hash . ContainsKey ( 0 ) ) { hash [ 0 ] = new Dictionary < int , int > ( ) ; } if ( ! hash [ 0 ] . ContainsKey ( count - 1 ) ) { hash [ 0 ] . Add ( count - 1 , 1 ) ; } else { hash [ 0 ] [ count - 1 ] = 1 ; } } } }