public static int getNextPow2TwinPrime ( int m ) { int pos = Arrays . binarySearch ( twinPrimesP2 , m + 1 ) ; if ( pos >= 0 ) return twinPrimesP2 [ pos ] ; else return twinPrimesP2 [ - pos - 1 ] ; }
Gets the next twin prime that is near a power of 2 and greater than or equal to the given value