login
Number of prime-powers [including primes] in the (up and down) neighborhood of n with Ceiling[Log[n]] radius.
26

%I #14 Oct 06 2016 02:43:39

%S 0,2,4,4,4,4,4,5,4,5,4,3,3,4,3,4,3,3,3,3,4,3,4,3,4,4,5,5,5,4,4,3,4,3,

%T 3,2,2,2,3,3,3,2,3,3,4,3,3,2,3,3,3,2,2,1,2,3,3,3,3,3,3,4,4,4,3,4,3,4,

%U 4,3,3,3,2,3,3,4,3,4,3,3,3,3,3,4,3,3,2,2,1,1,1,2,2,2,1,2,2,3,3,3,3,4,3,4,4

%N Number of prime-powers [including primes] in the (up and down) neighborhood of n with Ceiling[Log[n]] radius.

%C With increasing n the radius of log(n) slowly increases, while frequency of prime-powers decreases. Thus hard to estimate upper bound of terms in this sequence.

%C Heuristically a(n) = 0 about 1/e^2 = 13.53...% of the time. The first few instances are 1, 300, 324, 895, 896, 897, 898, 899, 1077, .... - _Charles R Greathouse IV_, Apr 30 2015

%F a(n) <= A023193(2*A004233(n)+1) + A000720(A000523(A004233(n) + n)) and so a(n) << log n/log log n (with constant at most 4 + 1/log(2) = 5.442...). Probably a(n) < 2 log n/log log n + O(log n/(log log n)^2). - _Charles R Greathouse IV_, Apr 29 2015

%e n=284736: in [284723,284749] around n, 8 prime(powers) occur,radius=13, a[284736]=8.

%t a[n_] := Select[Range[n - Ceiling[Log[n]], n + Ceiling[Log[n]]], PrimePowerQ] // Length; Array[a, 105] (* _Jean-François Alcover_, Oct 06 2016 *)

%o (PARI) a(n)=my(t=ceil(log(n))); sum(k=n-t,n+t,!!isprimepower(k)) \\ _Charles R Greathouse IV_, Apr 29 2015

%Y Cf. A096510, A096511, A096512.

%K nonn

%O 1,2

%A _Labos Elemer_, Jul 12 2004