Smallest number k such that k+2^m is composite for all m less than k: Difference between revisions

Content added Content deleted
(New post.)
m (Renamed a method.)
Line 84: Line 84:
int k = 3;
int k = 3;
while ( count < 5 ) {
while ( count < 5 ) {
if ( isValid(k) ) {
if ( isA033919(k) ) {
System.out.print(k + " ");
System.out.print(k + " ");
count += 1;
count += 1;
Line 93: Line 93:
}
}
private static boolean isValid(int aK) {
private static boolean isA033919(int aK) {
final BigInteger bigK = BigInteger.valueOf(aK);
final BigInteger bigK = BigInteger.valueOf(aK);
for ( int m = 1; m < aK; m++ ) {
for ( int m = 1; m < aK; m++ ) {