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-10 of 12 results. Next

A365930 a(n) = number of pairs {x,y} with (x,y > 1) such that x^y (= terms of A072103) has bit length n.

Original entry on oeis.org

0, 0, 1, 2, 4, 3, 8, 7, 10, 15, 19, 25, 38, 46, 66, 90, 126, 169, 240, 332, 467, 646, 909, 1270, 1787, 2513, 3529, 4966, 6998, 9853, 13897, 19594, 27644, 39011, 55064, 77741, 109790, 155062, 219049, 309472, 437278, 617928, 873288, 1234268, 1744597, 2466067, 3486093
Offset: 1

Views

Author

Karl-Heinz Hofmann, Sep 23 2023

Keywords

Comments

Number of pairs {x,y} with (x,y > 1) for which applies: 2^(n-1) <= x^y < 2^n-1.
In some special cases different pairs have the same result (see A072103 and the example here) and those multiple representations are counted separately.
There is no need to include 2^n-1 because it is a Mersenne number and it cannot be a power anyway.
Limit_{n->oo} a(n)/a(n-1) = sqrt(2) = A002193.
Terms of A365931 are the partial sums of this sequence.

Examples

			For n = 5 the smallest number with bit length 5 is 16 (= 10000 in binary), and the largest number with bit length 5 is 31 (= 11111 in binary). In this range 4 pairs can be found, namely: 2^4 = 16; 4^2 = 16; 5^2 = 25; 3^3 = 27.
		

Crossrefs

Cf. A072103, A365931 (partial sums).

Programs

  • Mathematica
    a[n_] := Sum[Ceiling[2^(n/k)] - Ceiling[2^((n-1)/k)], {k, 2, n}]; Array[a, 50] (* Amiram Eldar, Sep 23 2023 *)
  • PARI
    for (blen = 0, 25, my (b1=2^blen, b2=2*b1-1, np=0); for (x = b1, b2, my (m=ispower(x)); if (m>1, np+=(sumdiv(m,y,1)-1), np+=m)); print1 (np,", ")) \\ Hugo Pfoertner, Oct 02 2023
  • Python
    from sympy import integer_nthroot
    def A365930(n):
        return sum(integer_nthroot((2**n)-1,y)[0]-integer_nthroot(2**(n-1)-1,y)[0] for y in range(2, n+1))
    
  • Python
    from sympy import integer_nthroot, integer_log
    def A365930(n): # a bit more efficient program
        c, y, a, b = 0, 2, (1<Chai Wah Wu, Oct 16 2023
    

Formula

a(n) = Sum_{y=2..n} (ceiling(2^(n/y)) - ceiling(2^((n-1)/y))).
a(n) = Sum_{y=2..n} (floor((2^n-1)^(1/y)) - floor((2^(n-1)-1)^(1/y))).
a(n) = A365931(n) - A365931(n-1).

A365931 a(n) = number of pairs {x,y} with (x,y > 1) such that x^y (= terms of A072103) has bit length <= n.

Original entry on oeis.org

0, 0, 1, 3, 7, 10, 18, 25, 35, 50, 69, 94, 132, 178, 244, 334, 460, 629, 869, 1201, 1668, 2314, 3223, 4493, 6280, 8793, 12322, 17288, 24286, 34139, 48036, 67630, 95274, 134285, 189349, 267090, 376880, 531942, 750991, 1060463, 1497741, 2115669, 2988957, 4223225, 5967822, 8433889
Offset: 1

Views

Author

Karl-Heinz Hofmann, Oct 07 2023

Keywords

Comments

Number of pairs {x,y} with (x,y > 1) for which x^y < 2^n-1.
In some special cases different pairs have the same result (see A072103 and the example here) and those multiple representations are counted separately.
There is no need to include 2^n-1 because it is a Mersenne number and it cannot be a power anyway.
Limit_{n->oo} a(n)/a(n-1) = sqrt(2) = A002193.
Partial sums of A365930.

Examples

			For n = 6: the Mersenne number 2^6-1 = 63 is the largest number with bit length 6 and the upper bound for the following a(6) = 10 powers: 2^2, 2^3, 2^4, 2^5, 3^2, 3^3, 4^2, 5^2, 6^2, 7^2.
		

Crossrefs

Cf. A072103, A002193, A365930 (first differences).
Cf. A017912 (squares), A017981 (cubes).

Programs

  • Mathematica
    a[n_] := Sum[Ceiling[2^(n/k)] - 2, {k, 2, n}]; Array[a, 47]
  • Python
    from sympy import integer_nthroot, integer_log
    def A365931(n):
        result, nMersenne, new = 0, (1<
    				

Formula

a(n) = Sum_{y = 2..n} (ceiling(2^(n/y)) - 2)
a(n) = Sum_{y = 2..n} (floor((2^n-1)^(1/y)) - 1)
a(n) = Sum_{k = 1..n} A365930(k).

A001597 Perfect powers: m^k where m > 0 and k >= 2.

Original entry on oeis.org

1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000, 1024, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764
Offset: 1

Views

Author

Keywords

Comments

Might also be called the nontrivial powers. - N. J. A. Sloane, Mar 24 2018
See A175064 for number of ways to write a(n) as m^k (m >= 1, k >= 1). - Jaroslav Krizek, Jan 23 2010
a(1) = 1, for n >= 2: a(n) = numbers m such that sum of perfect divisors of x = m has no solution. Perfect divisor of n is divisor d such that d^k = n for some k >= 1. a(n) for n >= 2 is complement of A175082. - Jaroslav Krizek, Jan 24 2010
A075802(a(n)) = 1. - Reinhard Zumkeller, Jun 20 2011
Catalan's conjecture (now a theorem) is that 1 occurs just once as a difference, between 8 and 9.
For a proof of Catalan's conjecture, see the paper by Metsänkylä. - L. Edson Jeffery, Nov 29 2013
m^k is the largest number n such that (n^k-m)/(n-m) is an integer (for k > 1 and m > 1). - Derek Orr, May 22 2014
From Daniel Forgues, Jul 22 2014: (Start)
a(n) is asymptotic to n^2, since the density of cubes and higher powers among the squares and higher powers is 0. E.g.,
a(10^1) = 49 (49% of 10^2),
a(10^2) = 6400 (64% of 10^4),
a(10^3) = 804357 (80.4% of 10^6),
a(10^4) = 90706576 (90.7% of 10^8),
a(10^n) ~ 10^(2n) - o(10^(2n)). (End)
A proper subset of A001694. - Robert G. Wilson v, Aug 11 2014
a(10^n): 1, 49, 6400, 804357, 90706576, 9565035601, 979846576384, 99066667994176, 9956760243243489, ... . - Robert G. Wilson v, Aug 15 2014

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 66.
  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section D9.
  • René Schoof, Catalan's Conjecture, Springer-Verlag, 2008, p. 1.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A007916.
Subsequence of A072103; A072777 is a subsequence.
Union of A075109 and A075090.
There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2), and which are sometimes confused with the present sequence.
First differences give A053289.

Programs

  • Haskell
    import Data.Map (singleton, findMin, deleteMin, insert)
    a001597 n = a001597_list !! (n-1)
    (a001597_list, a025478_list, a025479_list) =
       unzip3 $ (1, 1, 2) : f 9 (3, 2) (singleton 4 (2, 2)) where
       f zz (bz, ez) m
        | xx < zz = (xx, bx, ex) :
                    f zz (bz, ez+1) (insert (bx*xx) (bx, ex+1) $ deleteMin m)
        | xx > zz = (zz, bz, 2) :
                    f (zz+2*bz+1) (bz+1, 2) (insert (bz*zz) (bz, 3) m)
        | otherwise = f (zz+2*bz+1) (bz+1, 2) m
        where (xx, (bx, ex)) = findMin m  --  bx ^ ex == xx
    -- Reinhard Zumkeller, Mar 28 2014, Oct 04 2012, Apr 13 2012
    
  • Magma
    [1] cat [n : n in [2..1000] | IsPower(n) ];
    
  • Maple
    isA001597 := proc(n)
        local e ;
        e := seq(op(2,p),p=ifactors(n)[2]) ;
        return ( igcd(e) >=2 or n =1 ) ;
    end proc:
    A001597 := proc(n)
        option remember;
        local a;
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if isA001597(a) then
                    return a ;
                end if;
             end do;
        end if;
    end proc:
    seq(A001597(n),n=1..70) ; # R. J. Mathar, Jun 07 2011
    N:= 10000: # to get all entries <= N
    sort({1,seq(seq(a^b, b = 2 .. floor(log[a](N))), a = 2 .. floor(sqrt(N)))}); # Robert FERREOL, Jul 18 2023
  • Mathematica
    min = 0; max = 10^4;  Union@ Flatten@ Table[ n^expo, {expo, Prime@ Range@ PrimePi@ Log2@ max}, {n, Floor[1 + min^(1/expo)], max^(1/expo)}] (* T. D. Noe, Apr 18 2011; slightly modified by Robert G. Wilson v, Aug 11 2014 *)
    perfectPowerQ[n_] := n == 1 || GCD @@ FactorInteger[n][[All, 2]] > 1; Select[Range@ 1765, perfectPowerQ] (* Ant King, Jun 29 2013; slightly modified by Robert G. Wilson v, Aug 11 2014 *)
    nextPerfectPower[n_] := If[n == 1, 4, Min@ Table[ (Floor[n^(1/k)] + 1)^k, {k, 2, 1 + Floor@ Log2@ n}]]; NestList[ nextPerfectPower, 1, 55] (* Robert G. Wilson v, Aug 11 2014 *)
    Join[{1},Select[Range[2000],GCD@@FactorInteger[#][[All,2]]>1&]] (* Harvey P. Dale, Apr 30 2018 *)
  • PARI
    {a(n) = local(m, c); if( n<2, n==1, c=1; m=1; while( cMichael Somos, Aug 05 2009 */
    
  • PARI
    is(n)=ispower(n) || n==1 \\ Charles R Greathouse IV, Sep 16 2015
    
  • PARI
    list(lim)=my(v=List(vector(sqrtint(lim\=1),n,n^2))); for(e=3,logint(lim,2), for(n=2,sqrtnint(lim,e), listput(v,n^e))); Set(v) \\ Charles R Greathouse IV, Dec 10 2019
    
  • Python
    from sympy import perfect_power
    def ok(n): return n==1 or perfect_power(n)
    print([m for m in range(1, 1765) if ok(m)]) # Michael S. Branicky, Jan 04 2021
    
  • Python
    import sympy
    class A001597() :
        def _init_(self) :
            self.a = [1]
        def at(self, n):
            if n <= len(self.a):
                return self.a[n-1]
            else:
                cand = self.at(n-1)+1
                while sympy.perfect_power(cand) == False:
                    cand += 1
                self.a.append(cand)
                return cand
    a001597 = A001597()
    for n in range(1,20):
        print(a001597.at(n)) # R. J. Mathar, Mar 28 2023
    
  • Python
    from sympy import mobius, integer_nthroot
    def A001597(n):
        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 kmax # Chai Wah Wu, Aug 13 2024
  • Sage
    def A001597_list(n) :
        return [k for k in (1..n) if k.is_perfect_power()]
    A001597_list(1764) # Peter Luschny, Feb 03 2012
    

Formula

Goldbach showed that Sum_{n >= 2} 1/(a(n)-1) = 1.
Formulas from postings to the Number Theory List by various authors, 2002:
Sum_{i >= 2} Sum_{j >= 2} 1/i^j = 1;
Sum_{k >= 2} 1/(a(k)+1) = Pi^2 / 3 - 5/2;
Sum_{k >= 2} 1/a(k) = Sum_{n >= 2} mu(n)(1- zeta(n)) approx = 0.87446436840494... See A072102.
For asymptotics see Newman.
For n > 1: gcd(exponents in prime factorization of a(n)) > 1, cf. A124010. - Reinhard Zumkeller, Apr 13 2012
a(n) ~ n^2. - Thomas Ordowski, Nov 04 2012
a(n) = n^2 - 2*n^(5/3) - 2*n^(7/5) + (13/3)*n^(4/3) - 2*n^(9/7) + 2*n^(6/5) - 2*n^(13/11) + o(n^(13/11)) (Jakimczuk, 2012). - Amiram Eldar, Jun 30 2023

Extensions

Minor corrections from N. J. A. Sloane, Jun 27 2010

A253641 Largest integer b such that n=a^b for some integer a; a(0)=a(1)=1 by convention.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

M. F. Hasler, Jan 25 2015

Keywords

Comments

A000005(a(n))-1 yields the number of times n is listed in A072103, i.e., the number of ways it can be written differently as perfect power.
For any n, a(n) >= 1 since n = n^1.
Integers n = 0 and n = 1 can be written as n^b with arbitrarily large b; to remain consistent with the preceding formula and the comment, the conventional choice a(n) = 1 seemed the best one.
The same as A052409 if the convention is dropped. - R. J. Mathar, Jan 29 2015

Examples

			a(4) = 2 since 4 = 2^2. a(64) = 6 since 64 = 2^6 (although also 64 = 4^3 = 8^2).
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n in {0, 1} then 1 else igcd(map(i->i[2], ifactors(n)[2])[]); fi; end: seq(a(n), n=0..120); # Ridouane Oudra, Jun 10 2025
  • PARI
    A253641(n)=max(ispower(n),1)
    
  • Python
    from math import gcd
    from sympy import factorint
    def A253641(n): return gcd(*factorint(n).values()) if n>1 else 1 # Chai Wah Wu, Aug 13 2024

A253642 Number of ways the perfect power A001597(n) can be written as a^b, with a, b > 1.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2015

Keywords

Comments

Run lengths of A072103. Also, the terms a(n) which exceed 1 constitute A175066. - Andrey Zabolotskiy, Aug 17 2016

Examples

			a(1)=0 since A001597(1)=1 can be written as a^b for a=1 and any b, but not using a base a > 1.
a(2)=a(3)=a(4)=1 since the following terms 4=2^2, 8=2^3 and 9=3^2 can be written as perfect powers in only one way.
a(5)=2 since A001597(5)=16=a^b for (a,b)=(2,4) and (4,2).
		

Crossrefs

Programs

  • PARI
    for(n=1,9999,(e=ispower(n))&&print1(numdiv(e)-1,","))
    
  • Python
    from math import gcd
    from sympy import mobius, integer_nthroot, divisor_count, factorint
    def A253642(n):
        if n == 1: return 0
        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 divisor_count(gcd(*factorint(kmax).values()))-1 # Chai Wah Wu, Aug 13 2024

Formula

a(n) = A000005(A253641(A001597(n))) - 1.
a(n) = A175064(n) - 1.

A089580 Total number of perfect powers > 1 below 10^n, counting multiple representations separately.

Original entry on oeis.org

3, 15, 49, 143, 406, 1174, 3507, 10674, 32965, 102716, 321797, 1011533, 3186389, 10050743, 31730134, 100228040, 316713623, 1001037546, 3164497349, 10004755374, 31632975598, 100021893194, 316274794666, 1000101078148, 3162495003352, 10000467510247, 31623782520064, 100002164895587
Offset: 1

Views

Author

Martin Renner, Dec 29 2003

Keywords

Comments

From Robert G. Wilson v, Jul 17 2016: (Start)
a(n) ~ sqrt(10^n).
a(n) - A089579(n) = A275358(n).
The four terms which make up the difference a(2) - A089579(2) are: 16 = 2^4 = 4^2, 64 = 2^6 = 4^3 = 8^2 and 81 = 3^4 = 9^2; one for 16, two for 64 and one for 81 making a total of 4. See A117453.
(End)
This sequence correlates (see Link) to A006880 via a power fit A*x^B. For example, using a(23) through a(29) one obtains (A,B) = (0.047272, 1.96592) with R^2 > 0.999999. This extrapolates A006880(30) as 1.46*10^28. The exponent well may be resolving to 2. - Bill McEachen, Mar 04 2025

Examples

			16 = 2^4 = 4^2 counts double, 256 = 2^8 = 4^4 = 16^2 counts three times.
		

Crossrefs

Cf. A089579 (counting multiple representations only once).

Programs

  • Mathematica
    Table[lim=10^n-1; Sum[Floor[lim^(1/k)]-1, {k,2,Floor[Log[2,lim]]}], {n,30}] (* T. D. Noe, Nov 16 2006 *)
  • Python
    # see link.

Formula

a(n) = Sum_{k = 1..n} A060298(k). - Karl-Heinz Hofmann, Sep 18 2023

Extensions

2 more terms from Martin Renner, Oct 02 2004
More terms from T. D. Noe, Nov 16 2006
More precise name by Hugo Pfoertner, Sep 16 2023

A245713 Sorted imperfect powers b^p with b > 0, p > 2, with multiplicity.

Original entry on oeis.org

1, 8, 16, 27, 32, 64, 64, 81, 125, 128, 216, 243, 256, 256, 343, 512, 512, 625, 729, 729, 1000, 1024, 1024, 1296, 1331, 1728, 2048, 2187, 2197, 2401, 2744, 3125, 3375, 4096, 4096, 4096, 4096, 4913, 5832, 6561, 6561, 6859, 7776, 8000, 8192, 9261
Offset: 1

Views

Author

Anatoly E. Voevudko, Jul 30 2014

Keywords

Comments

No multiple terms for b=1.
This sequence strictly follows requirements of the Beal conjecture.
Less than 550 of these powers satisfy 196 Beal's conjecture equations.

Crossrefs

Programs

  • Maple
    N:= 10^5: # to get all terms <= N
    L:= [1, seq(seq(b^p, p=3..floor(log[b](N))),b=2..floor(N^(1/3)))]:
    sort(L); # Robert Israel, Nov 09 2015
  • Mathematica
    mx = 10000; Join[{1}, Sort@ Flatten@ Table[b^p, {b, 2, Sqrt@ mx}, {p, 3, Log[b, mx]}]] (* Robert G. Wilson v, Nov 09 2015 *)
  • PARI
    A245713(lim)={my(L=List(1),lim2=logint(lim,2));for(p=3,lim2, for(b=2,sqrtnint(lim,p),listput(L, b^p);));listsort(L); print(L);} \\ Anatoly E. Voevudko, Sep 21 2015

A259362 a(1) = 1, for n > 1: a(n) is the number of ways to write n as a nontrivial perfect power.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Doug Bell, Jun 24 2015

Keywords

Comments

a(n) = number of integer pairs (i,j) for distinct values of i where i > 0, j > 1 and n = i^j. Since 1 = 1^r for all real values of r, the requirement for a distinct i causes a(1) = 1 instead of a(1) = infinity.
Alternatively, the sequence can be defined as: a(1) = 1, for n > 1: a(n) = number of pairs (i,j) such that i > 0, j > 1 and n = i^j.
A007916 = n, where a(n) = 0.
A001597 = n, where a(n) > 0.
A175082 = n, where n = 1 or a(n) = 0.
A117453 = n, where n = 1 or a(n) > 1.
A175065 = n, where n > 1 and a(n) > 0 and this is the first occurrence in this sequence of a(n).
A072103 = n repeated a(n) times where n > 1.
A075802 = min(1, a(n)).
A175066 = a(n), where n = 1 or a(n) > 1. This sequence is an expansion of A175066.
A253642 = 0 followed by a(n), where n > 1 and a(n) > 0.
A175064 = a(1) followed by a(n) + 1, where n > 1 and a(n) > 0.
Where n > 1, A001597(x) = n (which implies a(n) > 0), i = A025478(x) and j = A253641(n), then a(n) = A000005(j) - 1, which is the number of factors of j greater than 1. The integer pair (i,j) comprises the smallest value i and the largest value j where i > 0, j > 1 and n = i^j. The a(n) pairs of (a,b) where a > 0, b > 1 and n = a^b are formed with b = each of the a(n) factors of j greater than 1. Examples for n = {8,4096}:
a(8) = 1, A001597(3) = 8, A025478(3) = 2, A253641(8) = 3, 8 = 2^3 and A000005(3) - 1 = 1 because there is one factor of 3 greater than 1 [3]. The set of pairs (a,b) is {(2,3)}.
a(4096) = 5, A001597(82) = 4096, A025478(82) = 2, A253641(4096) = 12, 4096 = 2^12 and A000005(12) - 1 = 5 because there are five factors of 12 greater than 1 [2,3,4,6,12]. The set of pairs (a,b) is {(64,2),(16,3),(8,4),(4,6),(2,12)}.
A023055 = the ordered list of x+1 with duplicates removed, where x is the number of consecutive zeros appearing in this sequence between any two nonzero terms.
A070428(x) = number of terms a(n) > 0 where n <= 10^x.
a(n) <= A188585(n).

Examples

			a(6) = 0 because there is no way to write 6 as a nontrivial perfect power.
a(9) = 1 because there is one way to write 9 as a nontrivial perfect power: 3^2.
a(16) = 2 because there are two ways to write 16 as a nontrivial perfect power: 2^4, 4^2.
From _Friedjof Tellkamp_, Jun 14 2025: (Start)
n:       1, 2, 3, 4, 5, 6, 7, 8, 9, ...
Squares: 1, 0, 0, 1, 0, 0, 0, 0, 1, ... (A010052)
Cubes:   1, 0, 0, 0, 0, 0, 0, 1, 0, ... (A010057)
...
Sum:    oo, 0, 0, 1, 0, 0, 0, 1, 1, ...
a(1)=1:  1, 0, 0, 1, 0, 0, 0, 1, 1, ... (= this sequence). (End)
		

Crossrefs

Programs

  • Mathematica
    a[n_] := If[n == 1, 1, Sum[Boole[IntegerQ[n^(1/k)]], {k, 2, Floor[Log[2, n]]}]]; Array[a, 100] (* Friedjof Tellkamp, Jun 14 2025 *)
    a[n_] := If[n == 1, 1, DivisorSigma[0, Apply[GCD, Transpose[FactorInteger[n]][[2]]]] - 1]; Array[a, 100] (* Michael Shamos, Jul 06 2025 *)
  • PARI
    a(n) = if (n==1, 1, sum(i=2, logint(n, 2), ispower(n, i))); \\ Michel Marcus, Apr 11 2025

Formula

a(1) = 1, for n > 1: a(n) = A000005(A253641(n)) - 1.
If n not in A001597, then a(n) = 0, otherwise a(n) = A175064(x) - 1 where A001597(x) = n.
From Friedjof Tellkamp, Jun 14 2025: (Start)
a(n) = A089723(n) - 1, for n > 1.
a(n) = A010052(n) + A010057(n) + A374016(n) + (...), for n > 1.
Sum_{k>=2..n} a(k) = A089361(n), for n > 1.
G.f.: x + Sum_{j>=2, k>=2} x^(j^k).
Dirichlet g.f.: 1 + Sum_{k>=2} zeta(k*s)-1. (End)

A362424 Number of partitions of n into 2 distinct perfect powers (A001597).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 2, 1, 1, 2, 1, 0, 0, 2, 2, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 2, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 2, 1, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 19 2023

Keywords

Crossrefs

Programs

A337670 Numbers that can be expressed as both Sum x^y and Sum y^x where the x^y are not equal to y^x for any (x,y) pair and all (x,y) pairs are distinct.

Original entry on oeis.org

432, 592, 1017, 1040, 1150, 1358, 1388, 1418, 1422, 1464, 1554, 1612, 1632, 1713, 1763, 1873, 1889, 1966, 1968, 1973, 1990, 2091, 2114, 2190, 2291, 2320, 2364, 2451, 2589, 2591, 2612, 2689, 2697, 2719, 2753, 2775, 2803, 2813, 2883, 3087, 3127, 3141, 3146
Offset: 1

Views

Author

Matej Veselovac, Sep 15 2020

Keywords

Comments

Numbers m of form m = Sum_{i=1...k} b_i^e_i = Sum_{i=1...k} e_i^b_i such that b_i^e_i != e_i^b_i, b_i > 1, e_i > 1, k = |{{b_i, e_i}, i = 1, 2, ...}|, k > 1.
Terms of the sequence relate to the Diophantine equation Sum_{i=1...k} x_i = 0, k > 1, x_i != 0, where x_i = (b_i^e_i - e_i^b_i) such that b_i > 1, e_i > 1 and (i != j) => ({b_i, e_i} != {b_j, e_j}). That is, we are observing linear combinations of elements from {(r^n - n^r) : n,r > 1} \ {0}, under given conditions.
For sums with k = 20 terms, one infinite family of examples is known: "2^(2t) + t^(4) + 2^(2t+8) + (t+4)^(4) + 2^(2t+16) + (t+8)^(4) + 2^(2t+32) + (t+16)^(4) + 2^(2t+34) + (t+17)^(4) + 4^(t+1) + (2t+2)^(2) + 4^(t+2) + (2t+4)^(2) + 4^(t+10) + (2t+20)^(2) + 4^(t+14) + (2t+28)^(2) + 4^(t+18) + (2t+36)^(2)" is a term of the sequence, for every t > 4.

Examples

			17 = 2^3 + 3^2 = 3^2 + 2^3 is not in the sequence because {2,3} = {3,2} are not distinct.
25 = 3^3 + 2^4 = 3^3 + 4^2 is not in the sequence because 3^3 = 3^3 and 2^4 = 4^2 are commutative.
The smallest term of the sequence is:
  a(1) = 432 = 3^2 + 5^2 + 2^6 + 3^4 + 5^3 + 2^7
             = 2^3 + 2^5 + 6^2 + 4^3 + 3^5 + 7^2.
The smallest term that has more than one representation is:
  a(11) = 1554 = 3^2 + 7^2 + 6^3 + 2^8 + 4^5
               = 2^3 + 2^7 + 3^6 + 8^2 + 5^4,
  a(11) = 1554 = 3^2 + 5^2 + 2^6 + 10^2 + 2^7 + 3^5 + 2^8 + 3^6
               = 2^3 + 2^5 + 6^2 + 2^10 + 7^2 + 5^3 + 8^2 + 6^3.
Smallest terms with k = 5, 6, 7, 8, 9, 10 summands are:
  a(9)  = 1422 = 5^2 + 7^2 + 9^2 + 3^5 + 4^5
               = 2^5 + 2^7 + 2^9 + 5^3 + 5^4,
  a(1)  = 432  = 3^2 + 5^2 + 2^6 + 3^4 + 5^3 + 2^7
               = 2^3 + 2^5 + 6^2 + 4^3 + 3^5 + 7^2,
  a(2)  = 592  = 3^2 + 5^2 + 7^2 + 4^3 + 2^6 + 5^3 + 2^8
               = 2^3 + 2^5 + 2^7 + 3^4 + 6^2 + 3^5 + 8^2,
  a(11) = 1554 = 3^2 + 5^2 + 2^6 + 10^2 + 2^7 + 3^5 + 2^8 + 3^6
               = 2^3 + 2^5 + 6^2 + 2^10 + 7^2 + 5^3 + 8^2 + 6^3,
  a(14) = 1713 = 3^2 + 2^5 + 6^2 + 8^2 + 4^3 + 2^7 + 3^5 + 2^9 + 5^4
               = 2^3 + 5^2 + 2^6 + 2^8 + 3^4 + 7^2 + 5^3 + 9^2 + 4^5,
  a(28) = 2451 = 3^2 + 5^2 + 6^2 + 8^2 + 3^4 + 2^7 + 6^3 + 3^5 + 5^4 + 2^10
               = 2^3 + 2^5 + 2^6 + 2^8 + 4^3 + 7^2 + 3^6 + 5^3 + 4^5 + 10^2.
		

Crossrefs

Cf. A337671 (subsequence for k <= 5).
Cf. A005188 (perfect digital invariants).
Cf. Perfect powers: A001597, A072103.
Cf. Commutative powers: A271936.
Cf. Nonnegative numbers of the form (r^n - n^r), for n,r > 1: A045575.
Cf. Numbers of the form (r^n - n^r): A024012 (r = 2), A024026 (r = 3), A024040 (r = 4), A024054 (r = 5), A024068 (r = 6), A024082 (r = 7), A024096 (r = 8), A024110 (r = 9), A024124 (r = 10), A024138 (r = 11), A024152 (r = 12).
Showing 1-10 of 12 results. Next