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.

A359952 Wieferich sequence where a(1) = 2.

This page as a plain text file.
%I A359952 #15 Jan 28 2023 11:30:28
%S A359952 2,1093,5,20771,18043,5,20771,18043,5,20771,18043,5,20771,18043,5,
%T A359952 20771,18043,5,20771,18043,5,20771,18043,5,20771,18043,5,20771,18043,
%U A359952 5,20771,18043,5,20771,18043,5,20771,18043,5,20771,18043,5,20771,18043
%N A359952 Wieferich sequence where a(1) = 2.
%C A359952 Starting with a(3), the sequence is periodic with the following cycle, which is a Wieferich triplet: 5, 20771, 18043.
%H A359952 Wikipedia, <a href="https://en.wikipedia.org/wiki/Wieferich_prime#Wieferich_sequence">Wieferich sequence</a>.
%H A359952 Wikipedia, <a href="https://en.wikipedia.org/wiki/Wieferich_prime">Wieferich prime</a>.
%H A359952 Wikipedia, <a href="https://en.wikipedia.org/wiki/Wieferich_pair">Wieferich pair</a>.
%o A359952 (Python)
%o A359952 from sympy import nextprime
%o A359952 from gmpy2 import powmod
%o A359952 max_n = 45
%o A359952 a = 2
%o A359952 seq = [a]
%o A359952 for i in range(2, max_n+1):
%o A359952     p = 2
%o A359952     while True:
%o A359952         p_squared = p*p
%o A359952         if powmod(a, p-1, p_squared) == 1 and (a-1) % p_squared != 0 and (a+1) % p_squared != 0:
%o A359952             seq.append(p)
%o A359952             a = p
%o A359952             break
%o A359952         else:
%o A359952             p = nextprime(p)
%o A359952 print(seq)
%o A359952 (PARI) i=0; a=2; print1(a, ", "); while(i<100, forprime(p=2, 10^6, if(Mod(a, p^2)^(p-1)==1 && p%2!=0 && ((a-1) % p^2) && ((a+1) % p^2), print1(p, ", "); i++; a=p; break({n=1})))) \\ _Michel Marcus_, Jan 21 2023
%Y A359952 Cf. A178871, A179400, A179678, A244550, A297846.
%K A359952 nonn
%O A359952 1,1
%A A359952 _Robert C. Lyons_, Jan 19 2023