OFFSET
1,1
COMMENTS
a(n) = 9 for n == 1 or 8 mod 9 (see A056020).
LINKS
Richard N. Smith, Table of n, a(n) for n = 1..5000
Wikipedia, Euler-Jacobi pseudoprime
MATHEMATICA
ejpspQ[n_, b_] := CoprimeQ[n, b] && CompositeQ[n] && Mod[b^((n - 1)/2) - JacobiSymbol[b, n], n] == 0; leastEJpsp[b_] := Module[{k=9}, While[!ejpspQ[k, b], k+=2]; k]; Array[leastEJpsp, 100] (* Amiram Eldar, Jul 15 2019 *)
PROG
(PARI) isok(k, n) = ((k%2==1) && (gcd(k, n)==1) && Mod(n, k)^((k-1)/2)==kronecker(n, k) && !isprime(k));
a(n) = my(k=2); while (! isok(k, n), k++); k; \\ Michel Marcus, Jul 15 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Richard N. Smith, Jul 14 2019
STATUS
approved