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

A025478 Least roots of perfect powers (A001597).

Original entry on oeis.org

1, 2, 2, 3, 2, 5, 3, 2, 6, 7, 2, 3, 10, 11, 5, 2, 12, 13, 14, 6, 15, 3, 2, 17, 18, 7, 19, 20, 21, 22, 2, 23, 24, 5, 26, 3, 28, 29, 30, 31, 10, 2, 33, 34, 35, 6, 11, 37, 38, 39, 40, 41, 12, 42, 43, 44, 45, 2, 46, 3, 13, 47, 48, 7, 50, 51, 52, 14, 53, 54, 55, 5, 56, 57, 58, 15, 59, 60, 61, 62
Offset: 1

Views

Author

Keywords

Examples

			a(5) = 2 because pp(5) = 16 = 2^4 (not 4^2 as we take the smallest base).
		

Crossrefs

Cf. A052410 (least root), A001597 (perfect powers).
Cf. A025479 (largest exponents of perfect powers), A070228.

Programs

  • Haskell
    a025478 n = a025478_list !! (n-1)  -- a025478_list defined in A001597.
    -- Reinhard Zumkeller, Mar 11 2014
    
  • Mathematica
    pp = Select[ Range[5000], Apply[GCD, Last[ Transpose[ FactorInteger[ # ]]]] > 1 &]; f[n_] := Block[{b = 2}, While[ !IntegerQ[ Log[b, pp[[n]]]], b++ ]; b]; Join[{1}, Table[ f[n], {n, 2, 80}]]
    (* Second program: *)
    Prepend[DeleteCases[#, 0], 1] &@ Table[If[Set[e, GCD @@ #[[All, -1]]] > 1, Power[n, 1/e], 0] &@ FactorInteger@ n, {n, 4000}]  (* Michael De Vlieger, Apr 25 2017 *)
  • PARI
    lista(kmax) = {my(r, e); print1(1, ", "); for(k = 1, kmax, e = ispower(k, , &r); if(e > 0, print1(r, ", ")));} \\ Amiram Eldar, Sep 07 2024
  • Python
    from math import gcd
    from sympy import mobius, integer_nthroot, factorint
    def A025478(n):
        if n == 1: return 1
        def f(x): return int(n-2+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return integer_nthroot(kmax, gcd(*factorint(kmax).values()))[0] # Chai Wah Wu, Aug 13 2024
    

Formula

a(n) = A052410(A001597(n)).
(i) a(n) < n for n > 2. (ii) a(n)/n is bounded and lim sup a(n)/n must be around 0.7. (iii) Sum_{k=1..n} a(k) seems to be asymptotic to c*n^2 with c around 0.29. (iv) a(n) = 2 if n is in A070228 (proof seems self-evident), hence there is no asymptotic expression for a(n) (just the average in (iii)). - Benoit Cloitre, Oct 14 2002

Extensions

Definition edited and cross-reference added by Daniel Forgues, Mar 10 2009

A188951 Number of perfect powers (A001597) < 2^n.

Original entry on oeis.org

0, 1, 1, 2, 4, 7, 10, 15, 22, 30, 41, 57, 81, 113, 155, 216, 298, 416, 582, 813, 1135, 1588, 2223, 3115, 4368, 6135, 8622, 12127, 17063, 24022, 33838, 47688, 67226, 94804, 133737, 188709, 266350, 376018, 530940, 749819, 1059096, 1496143, 2113801, 2986769
Offset: 0

Views

Author

T. D. Noe, Apr 20 2011

Keywords

Examples

			For n=3, the perfect powers smaller than 2^3=8 are: 1 and 4. So a(3) = 2.
		

Crossrefs

Cf. A001597, A070228, A070428 (perfect powers not exceeding 10^n).

Programs

  • Mathematica
    Join[{0,1}, Table[-Sum[MoebiusMu[x]*Floor[2^(n/x) - 1], {x, 2, n}], {n, 2, 50}]]
  • PARI
    a(n) = sum(k=1, 2^n-1, (k==1) || ispower(k)); \\ Michel Marcus, Apr 11 2016
    
  • Python
    from sympy import mobius, integer_nthroot
    def A188951(n): return int(sum(mobius(x)*(1-integer_nthroot(1<Chai Wah Wu, Aug 13 2024

Formula

a(n) = A070228(n) - 1 for n > 1. - Amiram Eldar, May 19 2022

A380337 Number of perfect powers (in A001597) that do not exceed primorial A002110(n).

Original entry on oeis.org

1, 1, 2, 7, 19, 63, 208, 802, 3344, 15576, 82368, 453834, 2743903, 17510668, 114616907, 785002449, 5711892439, 43861741799, 342522899289, 2803468693325, 23621594605383, 201819398349092, 1793794228847381, 16342173067958793, 154171432351500060, 1518411003599957803
Offset: 0

Views

Author

Michael De Vlieger, Jan 21 2025

Keywords

Comments

In other words, A001597(a(n)) is the largest perfect power less than or equal to A002110(n).

Examples

			Let P = A002110 and let s = A001597.
a(0) = 1 since P(0) = 1, and the set s(1) = {1} contains k that do not exceed 1.
a(1) = 1 since P(1) = 2, and the set s(1) = {1} contains k <= 2.
a(2) = 2 since P(2) = 6, and the set s(1..2) = {1, 4} contains k <= 6.
a(3) = 7 since P(3) = 30, and the set s(1..7) = {1, 4, 8, 9, 16, 25, 27} contains k <= 30.
a(4) = 19 since P(4) = 210, and the set s(1..19) = {1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196} contains k <= 210, etc.
		

Crossrefs

Programs

  • Mathematica
    Map[1 - Sum[MoebiusMu[k]*Floor[#^(1/k) - 1], {k, 2, Floor[Log2[#]]}] &, FoldList[Times, 1, Prime[Range[30]]] ]
  • Python
    from sympy import primorial, mobius, integer_nthroot
    def A380337(n):
        if n == 0: return 1
        p = primorial(n)
        return int(1-sum(mobius(k)*(integer_nthroot(p,k)[0]-1) for k in range(2,p.bit_length()))) # Chai Wah Wu, Jan 23 2025
Showing 1-3 of 3 results.