OFFSET
1,2
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
{1} UNION {A001358 semiprimes} UNION {A074985 squares of semiprimes} UNION {cubes of semiprimes} UNION {4th powers of semiprimes} UNION ... - Jonathan Vos Post, Sep 06 2006
MATHEMATICA
Select[Range@ 166, Function[n, Or[n == 1, And[Length@ # == 1, EvenQ@ First@ #], And[Length@ # == 2, SameQ @@ #]] &[FactorInteger[n][[All, -1]]]]] (* Michael De Vlieger, Mar 04 2017 *)
PROG
(PARI) is(n)=my(f=factor(n)[, 2]); #f==0 || (#f==2 && f[1]==f[2]) || (#f==1 && f[1]%2==0) \\ Charles R Greathouse IV, Oct 19 2015
(Python)
from math import isqrt
from sympy import primepi, primerange, integer_nthroot
from oeis_sequences.OEISsequences import bisection
def A085155(n):
def f(x): return int(n+x-1+sum(((t:=primepi(s:=isqrt(y:=integer_nthroot(x, k)[0])))*(t-1)>>1)-sum(primepi(y//p) for p in primerange(s+1)) for k in range(1, x.bit_length())))
return bisection(f, n, n) # Chai Wah Wu, Jan 02 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 21 2003
STATUS
approved
