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

%I #24 Apr 14 2023 02:07:47

%S 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,

%T 28,15,30,6,22,9,12,18,36,10,27,20,40,21,42,35,31,23,46,44,21,13,35,

%U 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

%N Reciprocal of n modulo smallest prime greater than n.

%H Alois P. Heinz, <a href="/A122585/b122585.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Harvey P. Dale)

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/ModularInverse.html">Modular Inverse</a>

%F From _Alois P. Heinz_, Apr 13 2023: (Start)

%F a(n) = n <=> n in { A006093 }.

%F a(n) = (n+1)/2 <=> n in { A040976 } \ { 0 }. (End)

%p a:= n-> n&^(-1) mod nextprime(n):

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Apr 13 2023

%t Table[PowerMod[n,-1,NextPrime[n]],{n,80}] (* _Harvey P. Dale_, Apr 13 2023 *)

%o (Python)

%o from sympy import nextprime

%o def A122585(n): return pow(n,-1,nextprime(n)) # _Chai Wah Wu_, Apr 13 2023

%Y Cf. A006093, A040976, A124223, A151800, A362254.

%K nonn

%O 1,2

%A _Franklin T. Adams-Watters_, Oct 20 2006

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 25 07:41 EDT 2024. Contains 371964 sequences. (Running on oeis4.)