login
Number of numbers up to 10^n which are products of three primes.
19

%I #25 Sep 18 2024 15:46:21

%S 0,1,22,247,2569,25556,250853,2444359,23727305,229924367,2227121996,

%T 21578747909,209214982913,2030133769624,19717814526785,

%U 191693417109381,1865380637252270,18168907486812690,177123437184971927,1728190923820610000

%N Number of numbers up to 10^n which are products of three primes.

%F a(n) = A072114(10^n). - _R. J. Mathar_, May 25 2008

%e There are 22 numbers with three prime factors up to 10^2: 8, 12, 18, 20, 27, 28, 30, 42, 44, 45, 50, 52, 63, 66, 68, 70, 75, 76, 78, 92, 98, 99.

%t ThreeAlmostPrimePi[n_] := Sum[ PrimePi[n/(Prime@i*Prime@j)] - j + 1, {i, PrimePi[n^(1/3)]}, {j, i, PrimePi@ Sqrt[n/Prime@i]}]; Table[ ThreeAlmostPrimePi[10^n], {n, 0, 14}] (* _Robert G. Wilson v_ *)

%o (Python)

%o from math import isqrt

%o from sympy import primepi, primerange, integer_nthroot

%o def A109251(n):

%o r = 10**n

%o return int(sum(primepi(r//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(r,3)[0]+1)) for b,m in enumerate(primerange(k,isqrt(r//k)+1),a))) # _Chai Wah Wu_, Sep 18 2024

%Y Cf. A014612 = numbers with three prime factors, A036352 = number of numbers up to 10^n which are products of two primes, A072114.

%K nonn

%O 0,3

%A _Martin Raab_, Aug 19 2005

%E a(10)-a(14) from _Robert G. Wilson v_, Feb 06 2006

%E a(15)-a(17) from _Hiroaki Yamanouchi_, Aug 30 2014

%E a(18)-a(19) from _Henri Lifchitz_, Dec 01 2014