OFFSET
1,20
COMMENTS
What one can say about the average behavior of a(n) for large n? It is interesting in view of the Broughan-Qizhi inequality A192869(n) >> n*(log(n))^2 and their conjecture that A192869(n) = O(n*(log(n))^2). But in the case of A213982 we have, on average, log(n) possible odd positive and negative values of k with |k| < min (p_n-p_(n-1, p_(n+1)-p_n) which is approximately log(n).
Therefore, we conjecture that, on average, a(n) is approximately c*log(n) with c in (0,1). Calculations up to 10^6 (Peter J. C. Moses) show that, most likely, c < 0.298.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Kevin Broughan and Zhou Qizhi, Flat primes and thin primes, Bulletin of the Australian Mathematical Society 82:2 (2010), pp. 282-292.
EXAMPLE
a(1)=1, since 2+1 = 3 = 2^0*3;
a(2)=1, since 3+1 = 2^1*2;
a(7)=1, since 17-1 = 16 = 2^3*2;
a(10)=1, since 29-1 = 28 = 2^2*7.
MAPLE
f:= proc(n) local p, q, k, t;
p:= ithprime(n);
for k from 1 do
for t in [p+k, p-k] do
q:= t/2^padic:-ordp(t, 2);
if q=1 or isprime(q) then return k fi
od
od
end proc:
map(f, [$1..100]); # Robert Israel, Mar 27 2018
MATHEMATICA
Table[NestWhile[#+1&, 1, Not[Apply[Or, Flatten[PrimeQ[Map[(Prime[n] + #)/(2^Range[0, Floor[Log[Prime[n]]/Log[2]]])&, {-#, #}]]]]]&], {n, 100}] (* Peter J. C. Moses, Jul 09 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Jun 30 2012
EXTENSIONS
Name edited by Robert Israel, Mar 28 2018
STATUS
approved