A052130 a(n) is the number of numbers between 1 and 2^m with m-n prime factors (counted with multiplicity), for m sufficiently large.
1, 2, 7, 15, 37, 84, 187, 421, 914, 2001, 4283, 9184, 19611, 41604, 87993, 185387, 389954, 817053, 1709640, 3567978, 7433670, 15460810, 32103728, 66567488, 137840687, 285076323, 588891185, 1215204568, 2505088087, 5159284087
Offset: 0
Examples
Between 1 and 2^m there is just one number with m prime factors, namely 2^m, so a(0) = 1. For m >= 3, up to 2^m there are 2 numbers with m-1 prime factors, 2^(m-1) and 3*2^(m-2), so a(1) = 2.
Links
- Martin Raab, Table of n, a(n) for n = 0..41 (Terms 0..35 from Robert G. Wilson v)
- Index entries for sequences related to numbers of primes in various ranges
Programs
-
Mathematica
AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[ Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]] ]]]; (* Eric W. Weisstein, Feb 07 2006 *) Table[ AlmostPrimePi[Floor[n(1 + 1/Sqrt@2)] + 2, 2^(n + Floor[n(1 + 1/Sqrt@2)]) + 2], {n, 2, 30}] (* Robert G. Wilson v, Feb 21 2006 *)
-
Python
from math import prod, isqrt from sympy import primepi, primerange, integer_nthroot def A052130(n): if n<=1: return n+1 def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1))) k = 1 while 3**k<(r:=1<
Chai Wah Wu, Dec 03 2024
Extensions
More terms from David W. Wilson, Feb 01 2000
a(24)-a(29) from Robert G. Wilson v, Feb 21 2006
Comments