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.

A355858 a(n) = n^(2*n-1) mod (2*n-1).

Original entry on oeis.org

0, 2, 3, 4, 8, 6, 7, 2, 9, 10, 8, 12, 18, 26, 15, 16, 29, 2, 19, 5, 21, 22, 8, 24, 18, 32, 27, 32, 50, 30, 31, 8, 63, 34, 26, 36, 37, 32, 30, 40, 80, 42, 8, 11, 45, 32, 35, 22, 49, 35, 51, 52, 8, 54, 55, 14, 57, 87, 8, 2, 94, 77, 68, 64, 113, 66, 53, 107, 69
Offset: 1

Views

Author

Jonas Kaiser, Jul 20 2022

Keywords

Comments

If a(n) = n then 2*n-1 is prime or Fermat pseudoprime to base 2.

Crossrefs

Programs

  • Mathematica
    a[n_] := PowerMod[n, 2*n - 1, 2*n - 1]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
  • PARI
    a(n)=n^(2*n-1)%(2*n-1)
    
  • PARI
    a(n)=lift(Mod(n, 2*n-1)^(2*n-1)) \\ Rémy Sigrist, Jul 21 2022
    
  • Python
    def a(n): return pow(n, 2*n-1, 2*n-1)
    print([a(n) for n in range(1, 70)]) # Michael S. Branicky, Jul 23 2022