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 A176789 #14 Nov 26 2015 09:37:52 %S A176789 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, %T A176789 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, %U A176789 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 %N A176789 a(n) = (0!! - 1!! + 2!! - 3!! + ... + (-1)^(n-1)*(n-1)!!) mod n. %C A176789 Alternating sum of double factorials modulo n. %F A176789 a(n) = (Sum_{k=0..n-1} (-1)^k*k!!) mod n = (1 + (-1)^(n-1)*A129831(n-1)) mod n. %e A176789 a(1) = 0!! mod 1 = 1 mod 1 = 0. %e A176789 a(2) = (0!! - 1!!) mod 2 = (1 - 1) mod 2 = 0. %e A176789 a(3) = (0!! - 1!! + 2!!) mod 3 = (1 - 1 + 2) mod 3 = 2. %p A176789 A176789 := proc(n) %p A176789 modp(1-(-1)^n*A129831(n-1), n) ; %p A176789 end proc: # _R. J. Mathar_, Aug 22 2012 %t A176789 Table[Mod[Sum[(-1)^k k!!,{k,0,n-1}],n],{n,90}] (* _Harvey P. Dale_, Dec 08 2012 *) %Y A176789 Cf. A049782, A176787, A176788. %K A176789 easy,nonn %O A176789 1,3 %A A176789 _Paolo P. Lava_ & _Giorgio Balzarotti_, Apr 26 2010