A231119 Least positive k such that n * k^k + 1 is a prime, or 0 if no such k exists.
1, 1, 2, 1, 102414, 1, 2, 17, 2, 1, 36, 1, 2, 3, 2, 1, 210, 1, 20, 3, 990, 1, 6, 2, 2, 6, 2, 1
Offset: 1
Programs
-
Java
import java.math.BigInteger; public class A231119 { public static void main (String[] args) { for (int n = 1; n < 3333; n++) { BigInteger nn = BigInteger.valueOf(n); for (int k=1; k<10000; k++) { BigInteger p = nn.multiply(BigInteger.valueOf(k).pow(k)).add(BigInteger.ONE); if (p.isProbablePrime(80)) { System.out.printf("%d, ", k); break; } else System.out.printf("."); } } } }
Extensions
a(5) from Phillip Poplin, May 27 2025
Comments