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!)
A176789 a(n) = (0!! - 1!! + 2!! - 3!! + ... + (-1)^(n-1)*(n-1)!!) mod n. 2
0, 0, 2, 3, 2, 4, 5, 7, 4, 4, 2, 7, 3, 0, 4, 3, 5, 10, 3, 19, 7, 4, 3, 7, 14, 0, 10, 7, 5, 4, 29, 11, 4, 6, 14, 19, 4, 26, 13, 39, 13, 28, 2, 15, 19, 20, 11, 19, 14, 14, 40, 39, 0, 10, 4, 7, 7, 8, 7, 19, 26, 38, 28, 27, 39, 4, 57, 23, 43, 14, 5, 55, 30, 6, 64, 7, 70, 52, 50, 19, 37, 10, 75, 7 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Alternating sum of double factorials modulo n.
LINKS
FORMULA
a(n) = (Sum_{k=0..n-1} (-1)^k*k!!) mod n = (1 + (-1)^(n-1)*A129831(n-1)) mod n.
EXAMPLE
a(1) = 0!! mod 1 = 1 mod 1 = 0.
a(2) = (0!! - 1!!) mod 2 = (1 - 1) mod 2 = 0.
a(3) = (0!! - 1!! + 2!!) mod 3 = (1 - 1 + 2) mod 3 = 2.
MAPLE
A176789 := proc(n)
modp(1-(-1)^n*A129831(n-1), n) ;
end proc: # R. J. Mathar, Aug 22 2012
MATHEMATICA
Table[Mod[Sum[(-1)^k k!!, {k, 0, n-1}], n], {n, 90}] (* Harvey P. Dale, Dec 08 2012 *)
CROSSREFS
Sequence in context: A353853 A365384 A350840 * A308158 A325349 A320054
KEYWORD
easy,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 March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)