A226783 If n=0 (mod 5) then a(n)=0, otherwise a(n)=5^(-1) in Z/nZ*.
0, 1, 2, 1, 0, 5, 3, 5, 2, 0, 9, 5, 8, 3, 0, 13, 7, 11, 4, 0, 17, 9, 14, 5, 0, 21, 11, 17, 6, 0, 25, 13, 20, 7, 0, 29, 15, 23, 8, 0, 33, 17, 26, 9, 0, 37, 19, 29, 10, 0, 41, 21, 32, 11, 0, 45, 23, 35, 12, 0, 49, 25, 38
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,2,0,0,0,0,-1).
Programs
-
Maple
A226783 := proc(n) local x ; a := 5 ; m := 5 ; if n mod m = 0 or n = 1 then 0; else msolve(x*a=1,n) ; op(%) ; op(2,%) ; end if; end proc: # R. J. Mathar, Jun 28 2013
-
Mathematica
Inv[a_, mod_] := Which[mod == 1,0, GCD[a, mod] > 1, 0, True, Last@Reduce[a*x == 1, x, Modulus -> mod]];Table[Inv[5, n], {n, 1, 122}] CoefficientList[Series[-x^2(x^9-x^6-x^5-5x^4-x^2-2x-1)/((x-1)^2 (x^4+ x^3+ x^2+ x+ 1)^2),{x,0,120}],x] (* Harvey P. Dale, Oct 08 2016 *) Table[If[Mod[n, 5]==0, 0, ModularInverse[5, n]], {n, 1, 100}] (* Jean-François Alcover, Mar 14 2023 *)
-
PARI
a(n)=if(n%5,lift(Mod(1, n)/5),0) \\ Charles R Greathouse IV, Jun 18 2013
Formula
G.f.: -x^2*(x^9-x^6-x^5-5*x^4-x^2-2*x-1) / ( (x-1)^2*(x^4+x^3+x^2+x+1)^2 ). - Colin Barker, Jun 20 2013
a(5n+1) = A016813(n), n>0. a(5n+2)= A005408(n), n>0. a(5n+3) = A016789(n). a(5n+4)=n+1. - R. J. Mathar, Jun 28 2013
a(n) = Sum_{k=1..n} k*(floor((5k-1)/n)-floor((5k-2)/n)), n>1. - Anthony Browne, Jun 19 2016