|
|
A049782
|
|
a(n) = (0! + 1! + ... + (n-1)!) mod n.
|
|
10
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
Kurepa's conjecture is that gcd(!n,n!) = 2, n > 1. It is easy to prove that this is equivalent to showing that gcd(p,!p) = 1 for all odd primes p. In Guy, 2nd edition, it is stated that Mijajlovic has tested up to p = 10^6. Subsequently Gallot tested up to 2^26. I have continued up to just above p = 2^27, in fact to p < 144000000. There were no examples found where gcd(p,!p) > 1. - Paul Jobling, Dec 02 2004
According to Kellner, the conjecture has been proved by Barsky and Benzaghou. - T. D. Noe, Dec 02 2004
Barsky and Benzaghou withdrew their proof in 2011. I've extended the search up to 10^9; no counterexample was found. - Milos Tatarevic, Feb 01 2013
|
|
REFERENCES
|
R. K. Guy, Unsolved Problems in Number Theory, B44: is a(n) > 0 for n > 2?
|
|
LINKS
|
|
|
FORMULA
|
|
|
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:
|
|
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 *)
|
|
PROG
|
(Haskell)
a049782 :: Int -> Integer
a049782 n = (sum $ take n a000142_list) `mod` (fromIntegral n)
(Magma) [&+[Factorial(k-1): k in [1..n]] mod (n): n in [1..80]]; // Vincenzo Librandi, May 31 2019
(Sage) [mod(sum(factorial(k) for k in (0..n-1)), n) for n in (1..80)] # G. C. Greubel, Dec 11 2019
(GAP) List([1..80], n-> Sum([0..n-1], k-> Factorial(k)) mod n ); # G. C. Greubel, Dec 11 2019
|
|
CROSSREFS
|
Note that in the context of this sequence, !n is the left factorial A003422 not the subfactorial A000166.
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|