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.

Original entry on oeis.org

2, 1093, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043, 5, 20771, 18043
Offset: 1

Views

Author

Robert C. Lyons, Jan 19 2023

Keywords

Comments

Starting with a(3), the sequence is periodic with the following cycle, which is a Wieferich triplet: 5, 20771, 18043.

Crossrefs

Programs

  • 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
  • Python
    from sympy import nextprime
    from gmpy2 import powmod
    max_n = 45
    a = 2
    seq = [a]
    for i in range(2, max_n+1):
        p = 2
        while True:
            p_squared = p*p
            if powmod(a, p-1, p_squared) == 1 and (a-1) % p_squared != 0 and (a+1) % p_squared != 0:
                seq.append(p)
                a = p
                break
            else:
                p = nextprime(p)
    print(seq)