cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A120043 Number of 12-almost primes 12ap such that 2^n < 12ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 103, 234, 492, 1082, 2271, 4867, 10349, 21794, 45907, 96293, 202006, 421287, 879388, 1828931, 3800227, 7882784, 16325796, 33771056, 69767214, 143971956, 296771231, 611156696, 1257374970
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_12(2^n).

Examples

			(2^12, 2^13] there is one semiprime, namely 6144. 4096 was counted in the previous entry.
		

Crossrefs

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 *)
    t = Table[AlmostPrimePi[12, 2^n], {n, 0, 30}]; Rest@t - Most@t
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A120043(n):
        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)))
        def almostprimepi(n,k): return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n,0,1,1,k)) if k>1 else primepi(n))
        return -almostprimepi(m:=1<Chai Wah Wu, Aug 31 2024

A120036 Number of 5-almost primes 5ap such that 2^n < 5ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 5, 8, 21, 41, 91, 199, 403, 873, 1767, 3740, 7709, 15910, 32759, 67185, 138063, 281566, 576165, 1173435, 2390366, 4860357, 9873071, 20033969, 40612221, 82266433, 166483857, 336713632, 680482316, 1374413154, 2774347425
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_5(2^n) = 0, 0, 0, 0, 1, 2, 7, 15, 36, 77, 168, 367, 770, 1643,..

Examples

			(2^5, 2^6] there is one semiprime, namely 48. 32 was counted in the previous entry.
		

Crossrefs

Programs

  • Mathematica
    FiveAlmostPrimePi[n_] := Sum[ PrimePi[n/(Prime@i*Prime@j*Prime@k*Prime@l)] - l + 1, {i, PrimePi[n^(1/5)]}, {j, i, PrimePi[(n/Prime@i)^(1/4)]}, {k, j, PrimePi[(n/(Prime@i*Prime@j))^(1/3)]}, {l, k, PrimePi[(n/(Prime@i*Prime@j*Prime@k))^(1/2)]}]; t = Table[ FiveAlmostPrimePi[2^n], {n, 0, 37}]; Rest@t - Most@t

A120037 Number of 6-almost primes 6ap such that 2^n < 6ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 44, 96, 215, 439, 959, 1967, 4185, 8735, 18143, 37695, 77939, 161479, 332008, 684502, 1404867, 2882712, 5904454, 12078654, 24682057, 50375102, 102724466, 209250102, 425921989, 866187909, 1760280404, 3574740094
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_6(2^n).

Examples

			(2^6, 2^7] there is one semiprime, namely 96. 64 was counted in the previous entry.
		

Crossrefs

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 *)
    t = Table[AlmostPrimePi[6, 2^n], {n, 0, 30}]; Rest@t - Most@t

A120038 Number of 7-almost primes 7ap such that 2^n < 7ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 46, 99, 224, 461, 1013, 2093, 4459, 9388, 19603, 40946, 85087, 177200, 366248, 758686, 1565038, 3226717, 6641105, 13648299, 28018956, 57445770, 117667693, 240751326, 492172466, 1005221914, 2051468099
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_7(2^n).

Examples

			(2^7, 2^8] there is one semiprime, namely 192. 128 was counted in the previous entry.
		

Crossrefs

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 *)
    t = Table[AlmostPrimePi[7, 2^n], {n, 0, 30}]; Rest@t - Most@t

A120039 Number of 8-almost primes 8ap such that 2^n < 8ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 101, 229, 473, 1044, 2171, 4634, 9796, 20513, 43020, 89684, 187361, 388633, 807508, 1671160, 3455934, 7135226, 14708436, 30286472, 62280024, 127944070, 262543635, 538266791, 1102507513, 2256357137
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_8(2^n).

Examples

			(2^8, 2^9] there is one semiprime, namely 384. 256 was counted in the previous entry.
		

Crossrefs

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 *)
    t = Table[AlmostPrimePi[8, 2^n], {n, 0, 30}]; Rest@t - Most@t

A120040 Number of 9-almost primes 9ap such that 2^n < 9ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 102, 232, 482, 1062, 2217, 4738, 10051, 21083, 44315, 92608, 193824, 402936, 838879, 1739794, 3605077, 7457977, 15404202, 31781036, 65481376, 134777594, 277096118, 569173839, 1168002568, 2394834166
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_9(2^n).

Examples

			(2^9, 2^10] there is one semiprime, namely 768. 512 was counted in the previous entry.
		

Crossrefs

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 *)
    t = Table[AlmostPrimePi[9, 2^n], {n, 0, 30}]; Rest@t - Most@t

A120041 Number of 10-almost primes k such that 2^n < k <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 103, 233, 487, 1072, 2246, 4803, 10202, 21440, 45115, 94434, 197891, 412010, 858846, 1783610, 3700698, 7665755, 15853990, 32750248, 67564405, 139238488, 286625278, 589472979, 1211146741, 2486322304
Offset: 0

Views

Author

Keywords

Crossrefs

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 *)
    t = Table[AlmostPrimePi[10, 2^n], {n, 0, 39}]; Rest@t - Most@t
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A120041(n):
        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)))
        def almostprimepi(n,k): return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n,0,1,1,k)) if k>1 else primepi(n))
        return -almostprimepi(m:=1<Chai Wah Wu, Aug 31 2024

Formula

a(n) ~ 2^n log^9 n/(725760 n log 2). [Charles R Greathouse IV, Dec 28 2011]

A120042 Number of 11-almost primes 11ap such that 2^n < 11ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 103, 234, 490, 1078, 2261, 4844, 10294, 21659, 45609, 95580, 200422, 417715, 871452, 1811412, 3761623, 7798409, 16142081, 33373093, 68906782, 142120436, 292797806, 602653984, 1239225631
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_11(2^n).

Examples

			(2^11, 2^12] there is one semiprime, namely 3072. 2048 was counted in the previous entry.
		

Crossrefs

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 *)
    t = Table[AlmostPrimePi[11, 2^n], {n, 0, 30}]; Rest@t - Most@t
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A120042(n):
        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)))
        def almostprimepi(n, k): return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n, 0, 1, 1, k)) if k>1 else primepi(n))
        return -almostprimepi(m:=1<Chai Wah Wu, Jun 17 2025
Showing 1-8 of 8 results.