OFFSET
1,2
COMMENTS
On Mar 28 2012, Zhi-Wei Sun conjectured that a(n) is the (n+1)-th prime p_{n+1} with the only exceptions being a(1)=1, a(2)=4, a(4)=9 and a(9)=25. He has shown that 2(s_k)^2 (k=1,...,n) are indeed pairwise distinct modulo p_{n+1} and hence a(n) does not exceed p_{n+1}.
Compare a(n) with the sequence A210640.
The conjecture was verified for n up to 2*10^5 by the author in 2018, and for n up to 3*10^5 by Chang Zhang (a student at Nanjing Univ.) in June 2020. - Zhi-Wei Sun, Jun 22 2020
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..600
Zhi-Wei Sun, An amazing recurrence for primes, a message to Number Theory List, March 31, 2012.
Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
EXAMPLE
We have a(4)=9 since 2(s_1)^2=8, 2(s_2)^2=2, 2(s_3)^2=32, 2(s_4)^2=18 are pairwise distinct modulo 9 but not pairwise distinct modulo any of 1,...,8.
MATHEMATICA
s[n_]:=Sum[(-1)^k*Prime[k], {k, 1, n}]
f[n_]:=2*s[n]^2
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, 1, Prime[n+1]}];
Print[n]; Label[aa]; Continue, {n, 1, 600}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 31 2012
STATUS
approved