OFFSET
1,1
COMMENTS
The polynomial x^n + x^(n-1) - 1 is irreducible over the rationals (see Ljunggren link), so the Bunyakovsky conjecture implies that a(n) always exists. - Robert Israel, Nov 16 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..800
W. Ljunggren, On the irreducibility of certain trinomials and quadrinomials, Math. Scand. 8 (1960) 65-70.
Wikipedia, Bunyakovsky conjecture.
EXAMPLE
Consider n = 6. k^6 + k^5 - 1 evaluates to 1, 95, 971 for k = 1, 2, 3. Only the last of these numbers is prime, hence a(6) = 3.
MAPLE
f:= proc(n) local k;
for k from 2 do if isprime(k^n+k^(n-1)-1) then return k fi od
end proc:
map(f, [$1..100]); # Robert Israel, Nov 16 2016
MATHEMATICA
a[n_] := For[k = 2, True, k++, If[PrimeQ[k^n + k^(n-1) - 1], Return[k]]];
Array[a, 100] (* Jean-François Alcover, Feb 26 2019 *)
PROG
(PARI) {m=82; for(n=1, m, k=1; while(!isprime(k^n+k^(n-1)-1), k++); print1(k, ", "))} \\ Klaus Brockhaus, Dec 17 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Dec 14 2006
EXTENSIONS
Edited and extended by Klaus Brockhaus, Dec 17 2006
STATUS
approved