OFFSET
1,1
COMMENTS
If p is a prime, then a(p) is the smallest base b such that q = b^p - b + 1 is prime. These primes q == 1 (mod p) by Fermat's Little Theorem. Note that if p is a prime, then a(p) = 2 if and only if 2^p - 1 is prime, so p is a Mersenne exponent in A000043. Composite numbers n such that a(n) = 2 are 4, 6, 8, 10, 12, 14, 16, 22, 39, 45, 76, ... Cf. composite terms in A307625. Except 8, are these the same numbers?
a(80) does not exist because A276976(80) = 4 and b^8-b^4+1 is a factor of b^80-b^4+1. Similarly, a(n) also does not exist for n = 84, 160, 312, 320, 400, 588, 640, 684, 800, ... - Giovanni Resta, Apr 24 2019
FORMULA
q == 1 (mod n).
EXAMPLE
a(9) = 5 so the number 5^9 - 5^3 + 1 is a prime q == 1 (mod 9).
MATHEMATICA
fQ[n_, m_] := AllTrue[Range[2, n - 1], PowerMod[#, m, n] == PowerMod[#, n, n] &]; f[1] = 0; f[2] = 1; f[n_] := Module[{m = 0}, While[!fQ[n, m], m++]; m]; a[n_] := Module[{b = 2, m = f[n]}, While[!PrimeQ[b^n - b^m + 1], b++]; b]; Array[a, 79] (* Amiram Eldar, Apr 19 2019 *)
PROG
(PARI) a276976(n)=if(n<3, return(n-1)); forstep(m=1, n, n%2+1, for(b=0, n-1, if(Mod(b, n)^m-Mod(b, n)^n, next(2))); return(m)); \\ A276976
a(n) = my(b=2); while (!isprime(b^n - b^a276976(n) + 1), b++); b; \\ Michel Marcus, Apr 21 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Apr 19 2019
EXTENSIONS
More terms from Amiram Eldar, Apr 19 2019
STATUS
approved