A113516 Least k such that n^k-n+1 is prime.
2, 2, 2, 5, 2, 2, 13, 2, 3, 3, 5, 2, 3, 2, 2, 11, 2, 3, 17, 2, 2, 17, 4, 2, 3, 9, 2, 33, 7, 3, 7, 4, 2, 3, 5, 67, 5, 2, 9, 3, 2, 4, 25, 3, 4, 5, 5, 24, 3, 2, 3, 21, 3, 2, 9, 3, 2, 11, 2, 5, 3, 2, 4, 19, 31, 2, 29, 4, 2, 3019, 2, 21, 51, 3, 2, 3, 2, 2, 9, 2, 169, 965, 3, 3, 29, 3, 2848, 9, 2, 2, 3
Offset: 2
Keywords
Links
- Ernst S. Selmer, On the irreducibility of certain trinomials, Mathematica Scandinavica (1956), Volume: 4, page 287-302.
Programs
-
Mathematica
Table[k=1; While[ !PrimeQ[n^k-n+1], k++ ]; k, {n, 2, 92}]
-
PARI
a(n) = my(k=1); while (!isprime(n^k-n+1), k++); k; \\ Michel Marcus, Nov 20 2021
-
Python
from sympy import isprime def a(n): k = 2 while not isprime(n**k - n + 1): k += 1 return k print([a(n) for n in range(2, 71)]) # Michael S. Branicky, Nov 20 2021
Comments