OFFSET
1,1
COMMENTS
a(n) is obviously at least n. In March 2012, Zhi-Wei Sun conjectured that a(n) always exists and does not exceed 2.2*n for n > 1; he even thought that 2.2*n might be replaced by 2*n + 2.5*sqrt(n) for n > 1.
IFF n=p, a(n)=1.
For odd n's, lim_{n->inf.} a(n)/n = 1; for even n's, lim_{n->inf.} a(n)/n = 2.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..10000 (first 5000 terms from Zhi-Wei Sun)
Zhi-Wei Sun, On functions taking only prime values, preprint, arxiv:1202.6589 [math.NT], 2012-2013.
Zhi-Wei Sun, A representation problem involving consecutive primes, a message to Number Theory List, Mar 31 2012.
Zhi-Wei Sun, An amazing recurrence for primes, a message to Number Theory List, Mar 31 2012.
EXAMPLE
We have a(4) = 5 since 4 = 5 - 3 + 2 and 3 - 2 < 4.
MATHEMATICA
s[0_]:=0; s[n_]:=s[n]=Prime[n]-s[n-1]; Do[Do[If[s[j]-(-1)^(j-i)*s[i]==n, Print[n, " ", Prime[j]]; Goto[aa]], {j, 1, PrimePi[3n]}, {i, 0, j-1}]; Print[n]; Label[aa]; Continue, {n, 1, 5000}]
f[n_] := Block[{j = PrimePi[n]}, While[ !MemberQ[ Accumulate@ Table[(-1)^(j - i) Prime[i], {i, j, 1, -1}], n], j++]; Prime[j]]; Array[f, 60] (* Robert G. Wilson v, Apr 06 2012 *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Zhi-Wei Sun, Apr 05 2012
STATUS
approved