OFFSET
1,1
COMMENTS
By a conjecture of the author, a(n) <= 2*n+2.2*sqrt(n), and moreover a(n) <= n+4.6*sqrt(n) if n is odd. Clearly a(n)>n. We guess that a(2n)/(2n) --> 2 as n tends to the infinity.
Note that this sequence is different from A222579 which involves a stronger conjecture of the author.
Zhi-Wei Sun also conjectured that any positive even integer m can be written in the form p_n-p_{n-1}+...+(-1)^{n-k}*p_k with k < n and 2m-3.6*sqrt(m+1) < p_n < 2m+2.2*sqrt(m).
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
EXAMPLE
a(7) = 13 since 7 = 13-11+7-5+3.
a(20) = 41 since 20 = 41-37+31-29+23-19+17-13+11-7+5-3.
MATHEMATICA
s[0_]:=0
s[n_]:=s[n]=Prime[n]-s[n-1]
Do[Do[If[s[j]-(-1)^(j-i)*s[i]==m, Print[m, " ", Prime[j]]; Goto[aa]], {j, PrimePi[m]+1, PrimePi[2m+2.2Sqrt[m]]}, {i, 0, j-2}];
Print[m, " ", counterexample]; Label[aa]; Continue, {m, 1, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, May 19 2013
STATUS
approved