login
This site is supported by donations 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

Table of n, a(n) for n=1..84.

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

Cf. A049782, A176787, A176788.

Sequence in context: A284318 A322791 A304745 * A308158 A325349 A320054

Adjacent sequences:  A176786 A176787 A176788 * A176790 A176791 A176792

KEYWORD

easy,nonn

AUTHOR

Paolo P. Lava & Giorgio Balzarotti, Apr 26 2010

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 24 23:41 EDT 2019. Contains 326314 sequences. (Running on oeis4.)