A100612 a(n) = (0! + 1! + ... + (p-1)!) mod p, where p = prime(n).
0, 1, 4, 6, 1, 10, 13, 9, 21, 17, 2, 5, 4, 16, 18, 13, 28, 22, 65, 68, 55, 20, 27, 76, 80, 13, 50, 43, 65, 109, 56, 81, 93, 134, 82, 10, 131, 4, 30, 104, 29, 170, 104, 165, 9, 122, 130, 42, 225, 50, 69, 12, 128, 60, 147, 52, 16, 56, 7, 218, 154, 264, 198, 48, 299, 205, 251, 101
Offset: 1
Keywords
References
- R. K. Guy, Unsolved Problems in Number Theory, B44: is a(n)>0 for n>2?
Links
- Michel Marcus, Table of n, a(n) for n = 1..2000
- Vladica Andrejic and Milos Tatarevic, Searching for a counterexample to Kurepa's Conjecture, arXiv:1409.0800 [math.NT], 2014-2015.
- Vladica Andrejic, Alin Bostan, Milos Tatarevic, Improved algorithms for left factorial residues, arXiv:1904.09196 [math.NT], 2019.
- Luis H. Gallardo, Artin-Schreier, Erdős, and Kurepa’s conjecture, 2023.
- Romeo Mestrovic, Variations of Kurepa's left factorial hypothesis, arXiv preprint arXiv:1312.7037 [math.NT], 2013-2014.
- T. D. Noe, Plot of first 5000 terms (The red line gives prime(n). There are very few duplicate values in the sequence; the 5000 terms have 4476 values.)
Programs
-
Maple
lf:=n->add(k!,k=0..n-1); [seq(lf(ithprime(n)) mod ithprime(n),n=1..100)]; # 2nd program: A100612 := proc(n) local p,f,a,k; f := 1 ; a := 0 ; p := ithprime(n) ; for k from 0 to p-1 do a := modp(a+f,p) ; f := modp(f*(k+1),p) ; end do: a ; end proc: seq(A100612(n),n=1..50) ; # R. J. Mathar, Dec 19 2016
-
Mathematica
Table[Mod[Total[Range[0,n-1]!],n],{n,Prime[Range[70]]}] (* Harvey P. Dale, May 06 2013 *)
-
PARI
a(n) = {my(p = prime(n), v = vector(p-1, k, Mod(k, p))); for (k=2, p-1, v[k] *= v[k-1];); lift(1+vecsum(v));} \\ Michel Marcus, May 05 2019
Formula
a(n) = A236399(n) mod prime(n).
Comments