cp's OEIS Frontend

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.

A354689 Smallest Euler pseudoprime to base n.

This page as a plain text file.
%I A354689 #9 Feb 16 2025 08:34:03
%S A354689 9,341,121,341,217,185,25,9,91,9,133,65,21,15,341,15,9,25,9,21,65,21,
%T A354689 33,25,217,9,65,9,15,49,15,25,545,21,9,35,9,39,133,39,21,451,21,9,133,
%U A354689 9,65,49,25,21,25,51,9,55,9,33,25,57,15,341,15,9,341,9,33,65
%N A354689 Smallest Euler pseudoprime to base n.
%C A354689 An Euler pseudoprime to the base b is a composite number k which satisfies b^((k-1)/2) == +-1 (mod k).
%H A354689 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/EulerPseudoprime.html">Euler Pseudoprime.</a>
%F A354689 a(n) = 9 for n == 1 or 8 (mod 9).
%o A354689 (PARI) a(n) = my(m); forcomposite(k=3, oo, if(k%2 && ((m=Mod(n, k)^(k\2))==1 || m==k-1), return(k)));
%o A354689 (Python)
%o A354689 from sympy import isprime
%o A354689 from itertools import count
%o A354689 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))
%o A354689 print([a(n) for n in range(1, 67)]) # _Michael S. Branicky_, Jun 03 2022
%Y A354689 Cf. A006970, A090086, A298756, A326614.
%K A354689 nonn
%O A354689 1,1
%A A354689 _Jinyuan Wang_, Jun 03 2022