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.

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.