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!)
A176787 a(n) = (0!-1!+2!-3!....(-1)^(n-1)*(n-1)!) mod n. 3

%I #18 Apr 22 2015 17:10:14

%S 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 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 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 a(n) = (0!-1!+2!-3!....(-1)^(n-1)*(n-1)!) mod n.

%H Charles R Greathouse IV, <a href="/A176787/b176787.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A058006(n) mod n. - _R. J. Mathar_, Jul 13 2012

%e a(1) = 0! mod 1 = 1 mod 1 = 0;

%e a(2) = (0!-1!) mod 2 = (1 - 1) mod 2 = 0;

%e a(3) = (0!-1!+2!) mod 3 = (1 - 1 + 2) mod 3 = 2.

%p 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 Table[Mod[Sum[(-1)^k*k!, {k, 0, n - 1}], n], {n, 81}] (* _Michael De Vlieger_, Apr 22 2015 *)

%o (PARI) a(n) = sum(k=0, n-1, (-1)^k*k!) % n; \\ _Michel Marcus_, Apr 22 2015

%Y Cf. A049782, A064383 (n such that a(n) is 0).

%K nonn

%O 1,3

%A _Paolo P. Lava_ & _Giorgio Balzarotti_, Apr 26 2010

%E Edited by _Johannes W. Meijer_, Jun 28 2011

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 May 4 16:30 EDT 2024. Contains 372256 sequences. (Running on oeis4.)