OFFSET
1,1
COMMENTS
Inspired by an incorrect definition of strong pseudoprime to base 3.
As is obvious from the data, it fails to include all primes. Does include some composite numbers (pseudoprimes), namely 121, 286, 24046, 47197, 82513, ...
LINKS
Jeppe Stig Nielsen, Table of n, a(n) for n = 1..10000
Wikipedia, Strong pseudoprime
PROG
(PARI) is(p)=my(d=p-1); d/=2^valuation(d, 2); Mod(3, p)^d==1
(Python)
from itertools import count, islice
def inA363215(n): return pow(3, n-1>>(~(n-1)&n-2).bit_length(), n)==1
def A363215_gen(startvalue=2): # generator of terms >= startvalue
return filter(inA363215, count(max(startvalue, 2)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeppe Stig Nielsen, May 21 2023
STATUS
approved