login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A122585 Reciprocal of n modulo smallest prime greater than n. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harvey P. Dale)
Eric Weisstein's World of Mathematics, Modular Inverse
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)
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 *)
PROG
(Python)
from sympy import nextprime
def A122585(n): return pow(n, -1, nextprime(n)) # Chai Wah Wu, Apr 13 2023
CROSSREFS
Sequence in context: A293170 A341469 A101200 * A057449 A308601 A286931
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 14:49 EDT 2024. Contains 371914 sequences. (Running on oeis4.)