Data update

This commit is contained in:
Ingy döt Net 2023-09-16 17:28:03 -07:00
parent 5af6d93694
commit 796d366b97
455 changed files with 7413 additions and 1900 deletions

View file

@ -0,0 +1,26 @@
import java.math.BigInteger;
public final class RepunitPrimes {
public static void main(String[] aArgs) {
final int limit = 2_700;
System.out.println("Repunit primes, up to " + limit + " digits, in:");
for ( int base = 2; base <= 16; base++ ) {
System.out.print(String.format("%s%2s%s", "Base ", base, ": "));
String repunit = "";
while ( repunit.length() < limit ) {
repunit += "1";
if ( BigInteger.valueOf(repunit.length()).isProbablePrime(CERTAINTY_LEVEL) ) {
BigInteger value = new BigInteger(repunit, base);
if ( value.isProbablePrime(CERTAINTY_LEVEL) ) {
System.out.print(repunit.length() + " ");
}
}
}
System.out.println();
}
}
private static final int CERTAINTY_LEVEL = 20;
}