login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354689 Smallest Euler pseudoprime to base n. 0
9, 341, 121, 341, 217, 185, 25, 9, 91, 9, 133, 65, 21, 15, 341, 15, 9, 25, 9, 21, 65, 21, 33, 25, 217, 9, 65, 9, 15, 49, 15, 25, 545, 21, 9, 35, 9, 39, 133, 39, 21, 451, 21, 9, 133, 9, 65, 49, 25, 21, 25, 51, 9, 55, 9, 33, 25, 57, 15, 341, 15, 9, 341, 9, 33, 65 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

An Euler pseudoprime to the base b is a composite number k which satisfies b^((k-1)/2) == +-1 (mod k).

LINKS

Table of n, a(n) for n=1..66.

Eric Weisstein's World of Mathematics, Euler Pseudoprime.

FORMULA

a(n) = 9 for n == 1 or 8 (mod 9).

PROG

(PARI) a(n) = my(m); forcomposite(k=3, oo, if(k%2 && ((m=Mod(n, k)^(k\2))==1 || m==k-1), return(k)));

(Python)

from sympy import isprime

from itertools import count

def a(n): return next(k for k in count(3, 2) if not isprime(k) and ((r:=pow(n, (k-1)//2, k)) == 1 or r == k-1))

print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jun 03 2022

CROSSREFS

Cf. A006970, A090086, A298756, A326614.

Sequence in context: A090087 A090085 A098650 * A098652 A110695 A157589

Adjacent sequences:  A354686 A354687 A354688 * A354690 A354691 A354692

KEYWORD

nonn

AUTHOR

Jinyuan Wang, Jun 03 2022

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 28 18:53 EDT 2022. Contains 357081 sequences. (Running on oeis4.)