A087797 Primes, squares of primes and cubes of primes.
2, 3, 4, 5, 7, 8, 9, 11, 13, 17, 19, 23, 25, 27, 29, 31, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 127, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241
Offset: 1
Keywords
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
m=400;Union[Prime[Range[PrimePi[m]]],Prime[Range[PrimePi[m^(1/2)]]]^2,Prime[Range[PrimePi[m^(1/3)]]]^3] (* Vladimir Joseph Stephan Orlovsky, Apr 11 2011 *) With[{nn=70},Take[Union[Flatten[{#,#^2,#^3}&/@Prime[Range[nn]]]],nn]] (* Harvey P. Dale, Oct 16 2012 *)
-
PARI
is(n)=my(t=isprimepower(n)); t && t<4 \\ Charles R Greathouse IV, Oct 19 2015
-
Python
from math import isqrt from sympy import primepi, integer_nthroot def A087797(n): def f(x): return n+x-primepi(x)-primepi(isqrt(x))-primepi(integer_nthroot(x,3)[0]) m, k = n, f(n) while m != k: m, k = k, f(k) return int(m) # Chai Wah Wu, Aug 09 2024
Formula
a(n) ~ n log n. - Charles R Greathouse IV, Oct 19 2015
Comments