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

A275358 The difference between A089580(n) and A089579(n).

Original entry on oeis.org

0, 4, 10, 20, 41, 65, 114, 185, 297, 487, 809, 1339, 2253, 3824, 6544, 11297, 19620, 34216, 59926, 105258, 185356, 327039, 577906, 1022466, 1810789, 3209398, 5691825, 10099475, 17927609, 31833805, 56541947, 100449345, 178484340, 317187186, 563744378, 1002052726
Offset: 1

Views

Author

Robert G. Wilson v, Jul 24 2016

Keywords

Comments

Submitted on the request of Omar E. Pol 17 July 2016. (A089579).
a(n) is the sum of A175066(m)-1 over such m that A117453(m)<10^n. - Andrey Zabolotskiy, Aug 17 2016

Examples

			a(2) = A089580(2)-A089579(2) = 4 because of the three terms: 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.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{lim = 10^n -1}, Sum[ (Floor[ lim^(1/k)] - 1)(1 + MoebiusMu[k]), {k, 2, Floor[ Log[2, lim]]}]]; Array[f, 36]

Formula

a(n) = A089580(n) - A089579(n).
Limit_{n->oo} a(n+1)/a(n) = 1.778279... (A011007). - Altug Alkan, Aug 22 2016

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

A070428 Number of perfect powers (A001597) not exceeding 10^n.

Original entry on oeis.org

1, 4, 13, 41, 125, 367, 1111, 3395, 10491, 32670, 102231, 320990, 1010196, 3184138, 10046921, 31723592, 100216745, 316694005, 1001003332, 3164437425, 10004650118, 31632790244, 100021566157, 316274216762, 1000100055684
Offset: 0

Views

Author

Donald S. McDonald, May 15 2002

Keywords

Comments

In the programs for this sequence, 4*n can be replaced by the smaller floor(n*log(10)/log(2)). - T. D. Noe, Nov 17 2006

Examples

			a(1) = 4 because the powers 1, 4, 8, 9 do not exceed 10^1.
a(2) = 13 because 1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81 & 100, are the only perfect power numbers less than or equal to 100.
		

References

  • The Dominion (Wellington, NZ), 'wtd sell', 9 Nov. 1991.
  • sci.math, powers not exceeding n. nz science monthly advt, March 1993, 1:80 integers 1..10000 is perfect square or higher power.

Crossrefs

Cf. A001597.
Cf. A089579, A089580 (number of perfect powers (not including 1) < 10^n).

Programs

  • Mathematica
    f[n_] := 1 - Sum[ MoebiusMu[x]*Floor[10^(n/x) - 1], {x, 2, n*Log2[10]}]; Array[f, 25, 0] (* Robert G. Wilson v, May 22 2009; modified Aug 04 2014 *)
  • PARI
    for(n=0, 25, print1(sum(x=2, 4*n,-moebius(x)*(floor(10^(n/x)-1)))+1, ", ")); \\ Slightly modified by Jinyuan Wang, Mar 02 2020
    
  • Python
    from sympy import mobius, integer_nthroot
    def A070428(n): return int(1-sum(mobius(x)*(integer_nthroot(10**n,x)[0]-1) for x in range(2,(10**n).bit_length()))) # Chai Wah Wu, Aug 13 2024

Formula

a(n) ~ sqrt(10^n).

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 03 2002
Edited and extended by Robert G. Wilson v, Oct 11 2002

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

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

A378168 a(n) is the number of squares <= 10^n that are not higher powers, i.e., terms of A076467.

Original entry on oeis.org

2, 6, 24, 87, 292, 959, 3089, 9875, 31410, 99633, 315589, 998889, 3160340, 9996605, 31616816, 99989509, 316209268, 999967330, 3162219896, 9999897769, 31622595517, 99999679010, 316227196708, 999998989804, 3162275866962, 9999996815862, 31622770946248, 99999989953079
Offset: 1

Views

Author

Hugo Pfoertner, Nov 20 2024

Keywords

Examples

			a(1) = 2: squares <= 10 are 2^2 and 3^2;
a(2) = 6: 2 squares <= 10 and 5^2, 6^2, 7^2, 10^2, but not 4^2=2^4, 8^2=2^6, and 9^2=3^4;
a(3) = 24: 6 squares <= 100 and all squares between 11^2 and 31^2, except for 16^2=2^8, 25^2=5^4, and 27^2=3^6.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[MoebiusMu[k]*Floor[10^(n/(2k))-1],{k,Floor[Log2[10^n]-1]}],{n,28}] (* James C. McMahon, Nov 21 2024 *)
  • Python
    from math import gcd
    from sympy import integer_nthroot, mobius
    def A378168(n): return sum(mobius(k)*(integer_nthroot(10**(n//(a:=gcd(n,b:=k<<1))), b//a)[0]-1) for k in range(1, (10**n).bit_length()-1)) # Chai Wah Wu, Nov 20 2024

Formula

a(n) = Sum_{k=1..floor(log_2(10^n)-1)} mu(k)*floor(10^(n/(2k))-1). - Chai Wah Wu, Nov 20 2024

Extensions

a(20) onwards from Chai Wah Wu, Nov 20 2024

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.
Showing 1-7 of 7 results.