OFFSET
1,1
COMMENTS
When n>1, we have S_n!=S_{n-1}!=0 (mod m) for all m=1,...,S_{n-1} and hence a(n)>S_{n-1}. Zhi-Wei Sun conjectured that a(n) is always a prime not exceeding S_n.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..720
Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
EXAMPLE
a(3)=7 since 2!,(2+3)!,(2+3+5)! are pairwise distinct modulo m=7 but not pairwise distinct modulo m=2,3,4,5,6.
MATHEMATICA
s[n_]:=s[n]=Sum[Prime[k], {k, 1, n}]
f[n_]:=f[n]=s[n]!
R[n_, m_]:=Union[Table[Mod[f[k], m], {k, 1, n}]]
Do[Do[If[Length[R[n, m]]==n, Print[n, " ", m]; Goto[aa]], {m, Max[2, s[n-1]], s[n]}];
Print[n]; Label[aa]; Continue, {n, 1, 720}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 20 2012
STATUS
approved