OFFSET
1,1
COMMENTS
Conjecture: a(n)<=3n for all n>0. Moreover, a(2n-1)/(2n-1) and a(2n)/(2n) have limits 1 and 2 respectively, as n tends to the infinity.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Zhi-Wei Sun, On functions taking only prime values, arXiv:1202.6589.
EXAMPLE
a(6)=11 since 6=11-7+5-3 with 12 and 2 both practical;
a(7)=19 since 7=19-17+13-11+7-5+3-2 with 20 and 1 both practical;
a(806)=p_{358}=2411 since 806=p_{358}-p_{357}+...+p_{150}-p_{149} with p_{358}+1=2412 and p_{149}-1=858 both practical. Note that a(806)/806 is about 2.9913.
MATHEMATICA
f[n_]:=f[n]=FactorInteger[n]
Pow[n_, i_]:=Pow[n, i]=Part[Part[f[n], i], 1]^(Part[Part[f[n], i], 2])
Con[n_]:=Con[n]=Sum[If[Part[Part[f[n], s+1], 1]<=DivisorSigma[1, Product[Pow[n, i], {i, 1, s}]]+1, 0, 1], {s, 1, Length[f[n]]-1}]
pr[n_]:=pr[n]=n>0&&(n<3||Mod[n, 2]+Con[n]==0)
pp[k_]:=pp[k]=pr[Prime[k]+1]==True
pq[k_]:=pq[k]=pr[Prime[k]-1]==True
s[0_]:=0
s[n_]:=s[n]=Prime[n]-s[n-1]
Do[Do[If[pp[j]==True&&pq[i+1]==True&&s[j]-(-1)^(j-i)*s[i]==m, Print[m, " ", Prime[j]]; Goto[aa]], {j, PrimePi[m]+1, PrimePi[3m]}, {i, 0, j-2}];
Print[m, " ", counterexample]; Label[aa]; Continue, {m, 1, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 25 2013
STATUS
approved