Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #55 Mar 28 2018 23:15:30
%S 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,2,1,1,3,1,2,
%T 1,1,1,1,1,1,1,2,1,1,2,2,1,1,1,2,1,2,2,3,1,1,1,1,1,2,1,1,3,2,1,1,1,3,
%U 1,2,1,1,1,3
%N Least k >= 1 such that prime(n) +- k = 2^m * q, m >= 0, where q >= 2 is prime.
%C 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).
%C 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.
%H Robert Israel, <a href="/A213982/b213982.txt">Table of n, a(n) for n = 1..10000</a>
%H Kevin Broughan and Zhou Qizhi, <a href="http://www.math.waikato.ac.nz/~kab/papers/flatandthin4.pdf">Flat primes and thin primes</a>, Bulletin of the Australian Mathematical Society 82:2 (2010), pp. 282-292.
%e a(1)=1, since 2+1 = 3 = 2^0*3;
%e a(2)=1, since 3+1 = 2^1*2;
%e a(7)=1, since 17-1 = 16 = 2^3*2;
%e a(10)=1, since 29-1 = 28 = 2^2*7.
%p f:= proc(n) local p, q,k,t;
%p p:= ithprime(n);
%p for k from 1 do
%p for t in [p+k,p-k] do
%p q:= t/2^padic:-ordp(t,2);
%p if q=1 or isprime(q) then return k fi
%p od
%p od
%p end proc:
%p map(f, [$1..100]); # _Robert Israel_, Mar 27 2018
%t 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 *)
%Y Cf. A192869, A214018.
%K nonn
%O 1,20
%A _Vladimir Shevelev_, Jun 30 2012
%E Name edited by _Robert Israel_, Mar 28 2018