OFFSET
1,1
COMMENTS
Let p_1, p_2, p_3, ..., p_u be a set P of distinct prime numbers and let m_1, m_2, m_3, ..., m_u be a set V of variables. Then P is a Wieferich u-tuple if there exists a mapping from the elements of P to the elements of V such that each of the following congruences is satisfied:
m_1^(m_2-1) == 1 (mod (m_2)^2), m_2^(m_3-1) == 1 (mod (m_3)^2), ..., m_u^(m_1-1) == 1 (mod (m_1)^2).
EXAMPLE
The primes 31, 79, 251, 263, 421 and 1483 satisfy 31^(79-1) == 1 (mod 79^2), 79^(263-1) == 1 (mod 263^2), 263^(251-1) == 1 (mod 251^2), 251^(421-1) == 1 (mod 421^2), 421^(1483-1) == 1 (mod 1483^2) and 1483^(31-1) == 1 (mod 31^2), so those primes form a Wieferich tuple. Since 1483 is the largest member of the tuple, 1483 is a term of the sequence.
PROG
(PARI) findwiefs(vec, lim) = my(v=[]); for(k=1, #vec, forprime(p=1, lim, if(Mod(vec[k], p^2)^(p-1)==1, v=concat(v, [p])))); vecsort(v, , 8)
newprimes(v, w) = setminus(w, v)
is(n) = my(v=findwiefs([n], n), w=[], np=[]); while(1, w=findwiefs(v, n); if(newprimes(v, w)==[], return(0), if(setsearch(vecsort(newprimes(v, w)), n) > 0, return(1))); v=concat(v, newprimes(v, w)); v=vecsort(v, , 8))
forprime(p=1, , if(is(p), print1(p, ", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Jan 07 2018
EXTENSIONS
More terms from Felix Fröhlich, Jan 22 2018
STATUS
approved