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 A176787 #18 Apr 22 2015 17:10:14 %S A176787 0,0,2,0,0,2,4,4,8,0,5,8,0,4,5,12,9,8,15,0,11,16,19,20,20,0,17,4,20, %T A176787 20,10,28,5,26,25,8,0,34,26,20,2,32,6,16,35,42,7,44,11,20,26,0,21,44, %U A176787 5,4,53,20,33,20,49,10,53,60,0,38,6,60,65,60,65,44,16,0,20,72,60,26,5,60,17 %N A176787 a(n) = (0!-1!+2!-3!....(-1)^(n-1)*(n-1)!) mod n. %H A176787 Charles R Greathouse IV, <a href="/A176787/b176787.txt">Table of n, a(n) for n = 1..10000</a> %F A176787 a(n) = A058006(n) mod n. - _R. J. Mathar_, Jul 13 2012 %e A176787 a(1) = 0! mod 1 = 1 mod 1 = 0; %e A176787 a(2) = (0!-1!) mod 2 = (1 - 1) mod 2 = 0; %e A176787 a(3) = (0!-1!+2!) mod 3 = (1 - 1 + 2) mod 3 = 2. %p A176787 A176787 := proc(n): add((-1)^(k-1)*(k-1)!, k=1..n) mod n end: seq(A176787(n),n=1..81); # _Johannes W. Meijer_, Jun 28 2011 %t A176787 Table[Mod[Sum[(-1)^k*k!, {k, 0, n - 1}], n], {n, 81}] (* _Michael De Vlieger_, Apr 22 2015 *) %o A176787 (PARI) a(n) = sum(k=0, n-1, (-1)^k*k!) % n; \\ _Michel Marcus_, Apr 22 2015 %Y A176787 Cf. A049782, A064383 (n such that a(n) is 0). %K A176787 nonn %O A176787 1,3 %A A176787 _Paolo P. Lava_ & _Giorgio Balzarotti_, Apr 26 2010 %E A176787 Edited by _Johannes W. Meijer_, Jun 28 2011