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.
%I A122585 #25 Feb 16 2025 08:33:02 %S A122585 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 A122585 28,15,30,6,22,9,12,18,36,10,27,20,40,21,42,35,31,23,46,44,21,13,35, %U A122585 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 A122585 Reciprocal of n modulo smallest prime greater than n. %H A122585 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 A122585 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/ModularInverse.html">Modular Inverse</a> %F A122585 From _Alois P. Heinz_, Apr 13 2023: (Start) %F A122585 a(n) = n <=> n in { A006093 }. %F A122585 a(n) = (n+1)/2 <=> n in { A040976 } \ { 0 }. (End) %p A122585 a:= n-> n&^(-1) mod nextprime(n): %p A122585 seq(a(n), n=1..100); # _Alois P. Heinz_, Apr 13 2023 %t A122585 Table[PowerMod[n,-1,NextPrime[n]],{n,80}] (* _Harvey P. Dale_, Apr 13 2023 *) %o A122585 (Python) %o A122585 from sympy import nextprime %o A122585 def A122585(n): return pow(n,-1,nextprime(n)) # _Chai Wah Wu_, Apr 13 2023 %Y A122585 Cf. A006093, A040976, A124223, A151800, A362254. %K A122585 nonn %O A122585 1,2 %A A122585 _Franklin T. Adams-Watters_, Oct 20 2006