OFFSET
1,2
COMMENTS
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.
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
FORMULA
EXAMPLE
n=284736: in [284723,284749] around n, 8 prime(powers) occur,radius=13, a[284736]=8.
MATHEMATICA
a[n_] := Select[Range[n - Ceiling[Log[n]], n + Ceiling[Log[n]]], PrimePowerQ] // Length; Array[a, 105] (* Jean-François Alcover, Oct 06 2016 *)
PROG
(PARI) a(n)=my(t=ceil(log(n))); sum(k=n-t, n+t, !!isprimepower(k)) \\ Charles R Greathouse IV, Apr 29 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 12 2004
STATUS
approved