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-5 of 5 results.

A267712 Number of nontrivial prime powers p^k (k > 0) less than 10^n.

Original entry on oeis.org

7, 35, 193, 1280, 9700, 78734, 665134, 5762859, 50851223, 455062595, 4118082969, 37607992088, 346065767406, 3204942420923, 29844572385358, 279238346816392, 2623557174778438, 24739954338671299, 234057667428388198, 2220819603016308079, 21127269487386615271, 201467286693435354626, 1925320391619238700024, 18435599767386814628355, 176846309399257764978954, 1699246750872783231673649
Offset: 1

Views

Author

Daniel Mondot, Jan 19 2016

Keywords

Comments

This is the sum of A006880 and A267574, term by term.

Examples

			For n=1, there are 4 primes plus 3 prime powers less than 10^1: 2, 3, 4, 5, 7, 8, 9; 7 in total.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[Range[10^n], k_ /; PrimePowerQ@ k], {n, 6}] (* Michael De Vlieger, Jan 20 2016 *)
    f[n_] := Sum[PrimePi[10^(n/k)], {k, n*Log2[10]}]; Array[f, 14] (* Robert G. Wilson v, Aug 17 2017, after Giovanni Resta in A267574 *)
  • SageMath
    def A267712(n):
        gen = (p for p in srange(2, 10^n) if p.is_prime_power())
        return sum(1 for _ in gen)
    print([A267712(n) for n in range(1, 7)])  # Peter Luschny, Sep 16 2023

Formula

a(n) = A006880(n) + A267574(n).
a(n) = A238815(n) - 1. - Jon E. Schoenfield, Apr 19 2018

Extensions

a(20)-a(26) from Chai Wah Wu, Jan 25 2016

A381391 Number of k <= 10^n that are neither squarefree nor prime powers (i.e., k is in A126706).

Original entry on oeis.org

0, 29, 367, 3866, 39098, 391838, 3920154, 39205902, 392069187, 3920718974, 39207261564, 392072817656, 3920728751139, 39207289143932, 392072896183208, 3920728975677128, 39207289797472001, 392072898095046811, 3920728981307675534, 39207289814141997459, 392072898144605471040
Offset: 1

Views

Author

Michael De Vlieger, Feb 22 2025

Keywords

Examples

			Let S = A126706.
a(1) = 0 since the smallest term in S is 12.
a(2) = 29 since S(1..29) = {12, 18, 20, 24, ..., 99, 100}, etc.
		

Crossrefs

Programs

  • Mathematica
    Table[10^n - Sum[PrimePi@ Floor[10^(n/k)], {k, 2, Floor[Log2[10^n]]}] - Sum[MoebiusMu[k]*Floor[10^n/(k^2)], {k, Floor[Sqrt[10^n]]}], {n, 10}]
  • Python
    from math import isqrt
    from sympy import primepi, integer_nthroot, mobius
    def A381391(n):
        m = 10**n
        return int(-sum(primepi(integer_nthroot(m,k)[0]) for k in range(2,m.bit_length()))-sum(mobius(k)*(m//k**2) for k in range(2, isqrt(m)+1))) # Chai Wah Wu, Feb 23 2025

Formula

a(n) = 10^n - Sum_{k = 2..log_2(10^n)} pi(floor(10^(n/k))) - Sum_{k = 1..floor(sqrt(10^n))} mu(k)*floor(10^n/k^2), where pi = A000720 and mu = A008683.
a(n) = A011557(n) - A071172(n) - A267574(n).

A303220 a(n) is the number of n-digit proper prime powers.

Original entry on oeis.org

3, 7, 15, 26, 57, 128, 319, 849, 2285, 6395, 18072, 51914, 150497, 439554, 1292568, 3819778, 11341738, 33806234, 101113152, 303345648, 912494104, 2751564993, 8315282765, 25179029388, 76381806785, 232094778772, 706331084162, 2152626447195, 6569037508556
Offset: 1

Views

Author

Jon E. Schoenfield, Apr 19 2018

Keywords

Comments

First differences of A267574.

Examples

			a(1) = 3 because there are 3 1-digit proper prime powers: 2^2 = 4, 2^3 = 8, and 3^2 = 9.
a(2) = 7 because there are 7 2-digit proper prime powers: 2^4 = 16, 2^5 = 32, 2^6 = 64; 3^3 = 27, 3^4 = 81; 5^2 = 25; and 7^2 = 49.
		

Crossrefs

Cf. A267574.

Formula

a(n) = A267574(n) - A267574(n-1).

A365670 Number of perfect powers k which are not prime powers, and 1 < k < 10^n.

Original entry on oeis.org

0, 1, 14, 72, 257, 873, 2838, 9085, 28979, 92145, 292832, 930124, 2953569, 9376798, 29760901, 94434276, 299569798, 950072891, 3012393832, 9549260877, 30264906899, 95902117819, 303839485659, 962486295193, 3048497625289, 9654373954803, 30571355398031, 96797106918709
Offset: 1

Views

Author

Peter Luschny, Sep 16 2023

Keywords

Comments

k is a perfect power (A001597) <=> there exist integers m and b, b > 1, m >= 1, and k = m^b.
k is a prime power (A246655) <=> there exist integers p and b, b >= 1, p is a prime, and k = p^b.

Examples

			There are 14 perfect powers less than 1000 which are not prime powers:
6^2, 10^2, 12^2, 14^2, 6^3, 15^2, 18^2, 20^2, 21^2, 22^2, 24^2, 26^2, 28^2, 30^2.
		

Crossrefs

Programs

  • Python
    from sympy import mobius, integer_nthroot, primepi
    def A365670(n): return int(sum(mobius(x)*(1-(a:=integer_nthroot(10**n,x)[0]))-primepi(a) for x in range(2,(10**n).bit_length())))-1 if n>1 else n-1 # Chai Wah Wu, Aug 14 2024
  • SageMath
    def A365670(n):
        gen = (p for p in srange(2, 10^n)
               if p.is_perfect_power() and not p.is_prime_power())
        return sum(1 for _ in gen)
    print([A365670(n) for n in range(1, 7)])
    

Formula

a(n) = A089579(n) - A267574(n).
a(n) = card({k: 1 < k < 10^n and k in A131605}).
If k = m^b is a term counted by this sequence then base(k) = m is a term of A024619.

Extensions

Data based on A089579 and A267574.

A381496 Number of powerful numbers that are not prime powers that do not exceed 10^n.

Original entry on oeis.org

0, 0, 3, 28, 133, 510, 1790, 5997, 19639, 63541, 204037, 652173, 2078320, 6609816, 20993381, 66612867, 211222374, 669428537, 2120835892, 6717184256, 21270247404, 67341572823, 213173925948, 674739560651, 2135491756895, 6758117426102, 21385762133815, 67670426242420
Offset: 0

Views

Author

Michael De Vlieger, Feb 25 2025

Keywords

Comments

Number of k such that omega(k) > 1 and rad(k)^2 | k (i.e., in A286708) that do not exceed 10^n, where omega = A001221 and rad = A007947.

Examples

			Let S = A286708 = A001694 \ A246547 = A126706 \ A001694.
a(0) = a(1) = 0 since 36 is the smallest term in S.
a(2) = 3 since S(1..3) = {36, 72, 100}.
a(3) = 28 since S(4..28) = {108, 144, ..., 972, 1000}.
a(4) = 133 since S(29..133) = {1089, 1125, ..., 9801, 10000}, etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Boole[SquareFreeQ[k]]*Floor[Sqrt[10^n/k^3]], {k, 10^(n/3)}] - Sum[PrimePi[10^(n/k)], {k, 2, n*Log2[10]}] - 1, {n, 0, 12}]
  • Python
    from math import isqrt
    from sympy import primepi, integer_nthroot, mobius
    def A381496(n):
        def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
        m, l = 10**n, 0
        j, c = isqrt(m), -1-sum(primepi(integer_nthroot(m,k)[0]) for k in range(2,m.bit_length())),
        while j>1:
            k2 = integer_nthroot(m//j**2,3)[0]+1
            w = squarefreepi(k2-1)
            c += j*(w-l)
            l, j = w, isqrt(m//k2**3)
        return c+squarefreepi(integer_nthroot(m,3)[0])-l # Chai Wah Wu, Feb 25 2025

Formula

a(n) = -1 + Sum_{k=1..10^(n/3)} [rad(k)=k]*floor(sqrt(10^n/k^3)) - Sum_{k=2..n*log_2(10)} pi(10^(n/k)).
a(n) = -1 + A118896(n) - A267574(n).
a(n) < A381391(n) for n > 0 since A286708 is a proper subset of A126706.
Showing 1-5 of 5 results.