Finding the Nth balanced Prime
for ( int i = 1 ; i < v . Count - 1 ; i ++ ) { if ( ( int ) v [ i ] == ( int ) ( v [ i + 1 ] + v [ i - 1 ] ) / 2 ) c ++ ; if ( c == n ) return ( int ) v [ i ] ; } return 1 ; }