OFFSET
1,1
COMMENTS
a(n) is coprime to A002110(n).
LINKS
Eric Weisstein's World of Mathematics, Euler Pseudoprime.
PROG
(PARI) a(n) = my(b, m, p=factorback(primes(n))); forcomposite(k=9, oo, if(gcd(k, p)==1, b=2; while((m=Mod(b, k)^(k\2)) == 1 || m == k-1, b++); if(b>prime(n), return(k))));
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Jun 04 2022
STATUS
approved