OFFSET
1,1
COMMENTS
No prime found for n = 4, 27, 64 (see A239666).
If A239666(n) = 0, then a(n) = 0. - Michel Marcus, Dec 19 2025
LINKS
Michel Marcus, Table of n, a(n) for n = 1..300
MATHEMATICA
A097792Q[n_] := (Divisible[n, 4] && IntegerQ[Surd[n/4, 4]]) || Module[{f = FactorInteger[n], s}, AnyTrue[FactorInteger[GCD @@ f[[;; , 2]]][[;; , 1]], # > 2 && IntegerQ[s = Surd[n, #]] && IntegerQ[s/#] &]]; a[n_] := If[A097792Q[n], 0, Module[{b = n + 3}, While[! PrimeQ[n*b^n + 1], b++]; b]]; Array[a, 64] (* Amiram Eldar, Dec 19 2025 *)
PROG
(PARI) a(n) = if (is_A097792(n), 0, my(b=n+3); while (!ispseudoprime(n*b^n + 1), b++); b); \\ Michel Marcus, Dec 18 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 13 2017
EXTENSIONS
a(1) inserted, corrected and extended by Michel Marcus, Dec 19 2025
STATUS
approved
