login
A182003
a(n) = least prime p_k such that n = p_k - p_{k-1} + ... + (-1)^{k-j}p_j for some 1 <= j <= k, with p_k the k-th prime.
1
3, 2, 3, 5, 5, 11, 7, 11, 11, 17, 11, 17, 13, 23, 17, 23, 17, 31, 19, 41, 23, 41, 23, 47, 29, 47, 37, 59, 29, 59, 31, 59, 43, 67, 37, 67, 37, 67, 43, 73, 41, 83, 43, 83, 47, 101, 47, 97, 53, 97, 59, 97, 53, 103, 61, 109, 67, 127, 59, 131
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 *)
KEYWORD
nonn,nice
AUTHOR
Zhi-Wei Sun, Apr 05 2012
STATUS
approved