OFFSET
1,3
COMMENTS
The greedy inverse (indices of first occurrence of 1, 2, 3, ... in the sequence) is 2, 11, 91, 3, 12, 4, 59, -1, 8, 6, -1, 52, 7, 2550, -1, 14, 10, 15, 5461, 22, 9, 18, 205, 141, 4178, -1, 23, 17, 41, 39, -1, 5297, 937, -1, -1, -1, -1, 5248, 213, -1, 90, 48, 28, 4202, -1, 1718, 313, 64, 119, 27, ... where -1 means the number does not exist or is larger than 8000. - R. J. Mathar, Dec 19 2016
a(12397) = 31; a(54708) = 37. - Michel Marcus, May 11 2019
a(105527) = 35. - Michel Marcus, May 13 2019
a(16728884) = 26; a(62860131) = 35; sent by Milos Tatarevic. - Michel Marcus, May 18 2019
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.)
FORMULA
a(n) = A236399(n) mod prime(n).
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 02 2004
STATUS
approved