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.

Showing 1-1 of 1 results.

A122585 Reciprocal of n modulo smallest prime greater than n.

Original entry on oeis.org

1, 2, 2, 4, 3, 6, 8, 7, 5, 10, 6, 12, 4, 11, 8, 16, 9, 18, 17, 15, 11, 22, 24, 23, 7, 19, 14, 28, 15, 30, 6, 22, 9, 12, 18, 36, 10, 27, 20, 40, 21, 42, 35, 31, 23, 46, 44, 21, 13, 35, 26, 52, 49, 47, 44, 39, 29, 58, 30, 60, 11, 40, 50, 22, 33, 66, 53, 47, 35, 70, 36, 72, 13, 63, 59
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> n&^(-1) mod nextprime(n):
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 13 2023
  • Mathematica
    Table[PowerMod[n,-1,NextPrime[n]],{n,80}] (* Harvey P. Dale, Apr 13 2023 *)
  • Python
    from sympy import nextprime
    def A122585(n): return pow(n,-1,nextprime(n)) # Chai Wah Wu, Apr 13 2023

Formula

From Alois P. Heinz, Apr 13 2023: (Start)
a(n) = n <=> n in { A006093 }.
a(n) = (n+1)/2 <=> n in { A040976 } \ { 0 }. (End)
Showing 1-1 of 1 results.