This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A076845 #18 Apr 07 2025 14:27:52 %S A076845 1,1,1,2,1,1,2,1,1,2,1,2,16,1,1,4,3,1,2,1,1,4,1,3,2,1,2,10,1,1,108,3, %T A076845 1,2,1,1,2,2,1,2,1,3,2,1,2,20,2,1,2,1,1,2,1,1,2,1,4,2,2,7,8,3,1,2,1, %U A076845 24,2,1,1,12,4,3,8,1,1,4,3,1,194,3,1,2,1,2,2,1,8,2,1,1,4,2,2,54,1,1,4,1,1 %N A076845 Least k>0 such that n^k + n - 1 is prime. %C A076845 From _Robert Israel_, Apr 07 2025: (Start) %C A076845 No terms == 5 (mod 6), as x^k + x - 1 is divisible by x^2 - x - 1 when k == 5 (mod 6). %C A076845 a(113) > 7000 if it exists. (End) %H A076845 Robert Israel, <a href="/A076845/a076845.txt">Incomplete table of n, a(n) for n = 2 .. 1000</a>. -1 denotes a value that is > 3000 if it exists. %p A076845 f:= proc(n) local k; %p A076845 for k from 1 do if isprime(n^k+n-1) then return k fi od %p A076845 end proc: %p A076845 map(f, [$2..112]); # _Robert Israel_, Apr 07 2025 %t A076845 lk[n_]:=Module[{k=1},While[!PrimeQ[n^k+n-1],k++];k]; Array[lk,100,2] (* _Harvey P. Dale_, Jun 29 2017 *) %o A076845 (PARI) a(n) = {my(k=1); while(!isprime(n^k+n-1), k++); k;} \\ _Michel Marcus_, Nov 29 2013 %o A076845 (Haskell) %o A076845 a076845 n = head [k | k <- [1..], a010051'' (n ^ k + n - 1) == 1] %o A076845 -- _Reinhard Zumkeller_, Jul 17 2014 %Y A076845 Cf. A078178, A076846. %Y A076845 Cf. A010051. %K A076845 nonn %O A076845 2,4 %A A076845 _Benoit Cloitre_, Nov 20 2002