A049782 a(n) = (0! + 1! + ... + (n-1)!) mod n.
0, 0, 1, 2, 4, 4, 6, 2, 1, 4, 1, 10, 10, 6, 4, 10, 13, 10, 9, 14, 13, 12, 21, 10, 14, 10, 10, 6, 17, 4, 2, 26, 1, 30, 34, 10, 5, 28, 10, 34, 4, 34, 16, 34, 19, 44, 18, 10, 48, 14, 13, 10, 13, 10, 34, 34, 28, 46, 28, 34, 22, 2, 55, 26, 49, 34, 65, 30, 67, 34, 68, 10, 55, 42, 64, 66, 34
Offset: 1
References
- R. K. Guy, Unsolved Problems in Number Theory, B44: is a(n) > 0 for n > 2?
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Romeo Mestrovic, The Kurepa-Vandermonde matrices arising from Kurepa's left factorial hypothesis, Filomat 29:10 (2015), 2207-2215. DOI:10.2298/FIL1510207M
- Vladica Andrejic, Milos Tatarevic, Searching for a counterexample of Kurepa's Conjecture, arXiv:1409.0800 [math.NT], 2014.
- D. Barsky and B. Benzaghou, Nombres de Bell et somme de factorielles, Journal de Théorie des Nombres de Bordeaux, 16:1, No. 17, 2004.
- D. Barsky and B. Benzaghou, Erratum à l'article "Nombres de Bell et somme de factorielles", Journal de Théorie des Nombres de Bordeaux, 23:2 (2011), p. 527.
- Y. Gallot, More information.
- Bernd C. Kellner, Some remarks on Kurepa's left factorial, arXiv:math/0410477 [math.NT], 2004.
- Romeo Mestrovic, Variations of Kurepa's left factorial hypothesis, arXiv preprint arXiv:1312.7037 [math.NT], 2013-2014.
- Stephen A. Silver, C program to generate this sequence.
- M. Tatarevic, Searching for a counterexample to the Kurepa's left factorial hypothesis (p < 10^9).
Crossrefs
Programs
-
GAP
List([1..80], n-> Sum([0..n-1], k-> Factorial(k)) mod n ); # G. C. Greubel, Dec 11 2019
-
Haskell
a049782 :: Int -> Integer a049782 n = (sum $ take n a000142_list) `mod` (fromIntegral n) -- Reinhard Zumkeller, Nov 02 2011
-
Magma
[&+[Factorial(k-1): k in [1..n]] mod (n): n in [1..80]]; // Vincenzo Librandi, May 31 2019
-
Maple
a:= proc(n) local c, i, t; c, t:=1, 1; for i to n-1 do t:= (t*i) mod n; c:= c+t od; c mod n end: seq(a(n), n=1..100); # Alois P. Heinz, Feb 16 2013
-
Mathematica
Table[Mod[Sum[ i!, {i, 0, n-1}], n], {n, 80}] nn=80; With[{fcts=Accumulate[Range[0,nn]!]},Flatten[Table[Mod[Take[fcts,{n}], n], {n,nn}]]] (* Harvey P. Dale, Sep 22 2011 *)
-
PARI
a(n)=my(s=1,f=1); for(k=1,n, f=f*k%n; s+=f); s%n \\ Charles R Greathouse IV, Feb 07 2017
-
Sage
[mod(sum(factorial(k) for k in (0..n-1)), n) for n in (1..80)] # G. C. Greubel, Dec 11 2019
Formula
a(n) = A003422(n) mod n = !n mod n. - G. C. Greubel, Dec 11 2019
Extensions
More terms from Erich Friedman, who observes that the first 500 terms are nonzero. Independently extended by Stephen A. Silver.
Comments