A289899 Primes that are the largest member of a Wieferich cycle.
71, 1093, 4871
Offset: 1
Examples
71 is a term, since A039951(71) = 3, A039951(3) = 11 and A039951(11) = 71, so {3, 11, 71} is a Wieferich cycle of length 3 and 71 is the largest member of that cycle.
Programs
-
PARI
leastwieferich(base, bound) = forprime(p=1, bound, if(Mod(base, p^2)^(p-1)==1, return(p))); 0 is(n) = my(v=[leastwieferich(n, n)]); while(1, if(v[#v]==0, return(0), v=concat(v, leastwieferich(v[#v], n))); my(x=#v-1); while(x > 1, if(v[#v]==v[x], if(n==vecmax(v), return(1), return(0))); x--)) forprime(p=1, , if(is(p), print1(p, ", ")))
Comments