OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ n log n. - Charles R Greathouse IV, Oct 19 2015
EXAMPLE
MAPLE
F:= proc(t) local P;
P:= ifactors(t)[2];
nops(P) = 1 and (P[1][2]=1 or nops(numtheory:-factorset(P[1][2]))=1)
end proc:
select(F, [$2..1000]); # Robert Israel, Jul 20 2015
MATHEMATICA
Select[Range@ 240, Or[PrimeQ@ #, PrimePowerQ@ # && PrimePowerQ@ FactorInteger[#][[1, 2]]] &] (* Michael De Vlieger, Jul 20 2015 *)
PROG
(Haskell)
a096165 n = a096165_list !! (n-1)
a096165_list = filter ((== 1) . a010055 . a001222) $ tail a000961_list
-- Reinhard Zumkeller, Nov 17 2011
(PARI) is(n)=while(1, if(!(n=isprimepower(n)), return(0), if(n==1, return(1)))) \\ Anders Hellström, Jul 19 2015
(PARI) ispp(n)=n==1 || isprimepower(n)
is(n)=ispp(isprimepower(n)) \\ Charles R Greathouse IV, Oct 19 2015
(Python)
from sympy import primepi, integer_nthroot, factorint
def A096165(n):
def f(x): return int(n+x-sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length()) if len(factorint(k))<=1))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
return bisection(f, n, n) # Chai Wah Wu, Sep 12 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jul 25 2004
STATUS
approved