Form cyclic array of elements 1 to n - 1
for ( long i = 1 ; i < n - 1 ; ++ i ) for ( long j = 0 ; j < n - 1 ; ++ j ) initial_array [ ( int ) i , ( int ) j ] = initial_array [ ( int ) i - 1 , ( int ) ( ( int ) j + 1 ) % ( ( int ) n - 1 ) ] ;