OFFSET
1,5
LINKS
V. Shevelev, On critical small intervals containing primes, arXiv:0908.2319 [math.NT], 2009.
EXAMPLE
a(3) = 1 because prime(3)=5 can be generated in 1 step starting from x=2.
a(4) = 1 because prime(4)=7 can be generated in 1 step starting from x=3.
MAPLE
A164333 := proc(n)
if n = 1 then
13;
else
for a from procname(n-1)+1 do
if isA164333(a) then
return a;
end if;
end do;
end if;
end proc:
A164960aux := proc(p, strt)
local a, x;
if strt > p then
return 1000000000;
end if;
a := 0 ;
x := strt ;
while x < p do
x := A060264(x) ;
a := a+1 ;
end do;
if x = p then
return a ;
else
return 1000000000;
end if;
end proc:
A164960 := proc(n)
local p, a, strt, i;
p := ithprime(n) ;
a := A164960aux(p, 2) ;
a := min(a, A164960aux(p, 3)) ;
for i from 1 do
strt := A164333(i) ;
if strt > p then
return a;
else
a := min(a, A164960aux(p, strt)) ;
end if;
end do:
return a;
end proc:
seq(A164960(n), n=1..90) ; # R. J. Mathar, Oct 29 2011
MATHEMATICA
nmax = 100; kmax = nmax + 5;
A164333 = Select[Table[{(Prime[k - 1] + 1)/2, (Prime[k] - 1)/2}, {k, 3, kmax}], AllTrue[Range[#[[1]], #[[2]]], CompositeQ] &][[All, 2]]*2 + 1;
A164960aux[p_, strt_] := Module[{a, x}, If[strt > p, Return[10^9]]; a = 0; x = strt; While[x < p, x = NextPrime[2 x]; a++]; If[x == p, Return[a], Return[10^9]]];
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Sep 02 2009
EXTENSIONS
One term corrected, sequence extended, examples added by R. J. Mathar, Oct 29 2011
STATUS
approved