OFFSET
1,1
LINKS
PROG
(Python)
from sympy import gcd, isprime
def pollard_rho(n):
x, y, d = 2, 2, 1
f = lambda x: x*x-1
while d==1:
x = f(x) % n
y = f(f(y)) % n
d = gcd(abs(x-y), n)
return d
isok = lambda n: not isprime(n) and pollard_rho(n) == n
print([n for n in range(4, 3201) if isok(n)])
(PARI)
f(x) = x^2-1;
p(n) = my(x=2, y=2, d=1); while(d==1, x=f(x); y=f(f(y)); d=gcd(abs(x-y), n)); d;
isok(n) = !isprime(n) && p(n) == n;
CROSSREFS
KEYWORD
nonn
AUTHOR
Darío Clavijo, Jun 20 2024
STATUS
approved