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 694 results. Next

A053289 First differences of consecutive perfect powers (A001597).

Original entry on oeis.org

3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, 33, 35, 19, 18, 39, 41, 43, 28, 17, 47, 49, 51, 53, 55, 57, 59, 61, 39, 24, 65, 67, 69, 71, 35, 38, 75, 77, 79, 81, 47, 36, 85, 87, 89, 23, 68, 71, 10, 12, 95, 97, 99, 101, 103, 40, 65, 107, 109, 100
Offset: 1

Views

Author

Labos Elemer, Mar 03 2000

Keywords

Comments

Michel Waldschmidt writes: Conjecture 1.3 (Pillai). Let k be a positive integer. The equation x^p - y^q = k where the unknowns x, y, p and q take integer values, all >= 2, has only finitely many solutions (x,y,p,q). This means that in the increasing sequence of perfect powers [A001597] the difference between two consecutive terms [the present sequence] tends to infinity. It is not even known whether for, say, k=2, Pillai's equation has only finitely many solutions. A related open question is whether the number 6 occurs as a difference between two perfect powers. See Sierpiński [1970], problem 238a, p. 116. - Jonathan Vos Post, Feb 18 2008
Are there are any adjacent equal terms? - Gus Wiseman, Oct 08 2024

Examples

			Consecutive perfect powers are A001597(14) = 121, A001597(13) = 100, so a(13) = 121 - 100 = 21.
		

References

  • Wacław Sierpiński, 250 problems in elementary number theory, Modern Analytic and Computational Methods in Science and Mathematics, No. 26, American Elsevier, Warsaw, 1970, pp. 21, 115-116.
  • S. S. Pillai, On the equation 2^x - 3^y = 2^X - 3^Y, Bull, Calcutta Math. Soc. 37 (1945) 15-20.

Crossrefs

For non-perfect-powers (A007916) we have A375706.
The union is A023055.
For prime-powers (A000961 or A246655) we have A057820.
Sorted positions of first appearances are A376268, complement A376519.
For second differences we have A376559.
Ascending and descending points are A376560 and A376561.
A001597 lists perfect-powers.
A112344 counts integer partitions into perfect-powers, factorizations A294068.
A333254 gives run-lengths of differences between consecutive primes.

Programs

  • Mathematica
    Differences@ Select[Range@ 3200, # == 1 || GCD @@ FactorInteger[#][[All, 2]] > 1 &] (* Michael De Vlieger, Jun 30 2016, after Ant King at A001597 *)
  • Python
    from sympy import mobius, integer_nthroot
    def A053289(n):
        if n==1: return 3
        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)+1 >= kmax:
            kmax <<= 1
        rmin, rmax = 1, kmax
        while True:
            kmid = kmax+kmin>>1
            if f(kmid)+1 < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        while True:
            rmid = rmax+rmin>>1
            if f(rmid) < rmid:
                rmax = rmid
            else:
                rmin = rmid
            if rmax-rmin <= 1:
                break
        return kmax-rmax # Chai Wah Wu, Aug 13 2024

Formula

a(n) = A001597(n+1) - A001597(n). - Jonathan Vos Post, Feb 18 2008
From Amiram Eldar, Jun 30 2023: (Start)
Formulas from Jakimczuk (2016):
Lim sup_{n->oo} a(n)/(2*n) = 1.
Lim inf_{n->oo} a(n)/(2*n)^(2/3 + eps) = 0. (End)
Can be obtained by inserting 0 between 3 and 6 in A375702 and then adding 1 to all terms. In particular, for n > 2, a(n+1) - 1 = A375702(n). - Gus Wiseman, Sep 14 2024

A376559 Second differences of consecutive perfect powers (A001597). First differences of A053289.

Original entry on oeis.org

1, -3, 6, 2, -7, 3, -1, 9, 2, 2, 2, 2, -17, -1, 13, 9, 2, -7, -11, 9, -5, 20, 2, -16, -1, 21, 2, 2, -15, -11, 30, 2, 2, 2, 2, 2, 2, 2, -22, -15, 41, 2, 2, 2, -36, 3, 37, 2, 2, 2, -34, -11, 49, 2, 2, -66, 45, 3, -61, 2, 83, 2, 2, 2, 2, -63, 25, 42, 2, -9, -89
Offset: 1

Views

Author

Gus Wiseman, Sep 28 2024

Keywords

Comments

Perfect-powers A007916 are numbers with a proper integer root.
Does this sequence contain zero?

Examples

			The perfect powers (A001597) are:
  1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, ...
with first differences (A053289):
  3, 4, 1, 7, 9, 2, 5, 4, 13, 15, 17, 19, 21, 4, 3, 16, 25, 27, 20, 9, 18, 13, ...
with first differences (A376559):
  1, -3, 6, 2, -7, 3, -1, 9, 2, 2, 2, 2, -17, -1, 13, 9, 2, -7, -11, 9, -5, 20, ...
		

Crossrefs

The version for A000002 is A376604, first differences of A054354.
For first differences we have A053289, union A023055, firsts A376268, A376519.
A000961 lists prime-powers inclusive, exclusive A246655.
A001597 lists perfect-powers, complement A007916.
A112344 counts integer partitions into perfect-powers, factorizations A294068.
For perfect-powers: A053289 (first differences), A376560 (positive curvature), A376561 (negative curvature).
For second differences: A036263 (prime), A073445 (composite), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power), A376599 (non-prime-power).

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Differences[Select[Range[1000],perpowQ],2]
  • PARI
    lista(nn) = my(v = concat (1, select(ispower, [1..nn])), w = vector(#v-1, i, v[i+1] - v[i])); vector(#w-1, i, w[i+1] - w[i]); \\ Michel Marcus, Oct 02 2024
  • Python
    from sympy import mobius, integer_nthroot
    def A376559(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        a = bisection(f,n,n)
        b = bisection(lambda x:f(x)+1,a,a)
        return a+bisection(lambda x:f(x)+2,b,b)-(b<<1) # Chai Wah Wu, Oct 02 2024
    

A294068 Number of factorizations of n using perfect powers (elements of A001597) other than 1.

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, 2, 0, 0, 0, 2, 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, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
Offset: 1

Views

Author

Gus Wiseman, May 05 2018

Keywords

Examples

			The a(1152) = 7 factorizations are (4*4*8*9), (4*8*36), (4*9*32), (8*9*16), (8*144), (9*128), (32*36).
		

Crossrefs

Programs

  • Maple
    ispp:= proc(n) local F;
      F:= ifactors(n)[2];
      igcd(op(map(t -> t[2],F)))>1
    end proc:
    f:= proc(n) local F, np, Q;
      F:= map(t -> t[2], ifactors(n)[2]);
      np:= mul(ithprime(i)^F[i],i=1..nops(F));
      Q:= select(ispp, numtheory:-divisors(np));
      G(Q,np)
    end proc:
    G:= proc(Q,n) option remember; local q,t,k;
        if not numtheory:-factorset(n) subset `union`(seq(numtheory:-factorset(q),q=Q)) then return 0 fi;
        q:= Q[1]; t:= 0;
        for k from 0 while n mod q^k = 0 do
          t:= t + procname(Q[2..-1],n/q^k)
        od;
        t
    end proc:
    G({},1):= 1:
    map(f, [$1..200]); # Robert Israel, May 06 2018
  • Mathematica
    ppQ[n_]:=And[n>1,GCD@@FactorInteger[n][[All,2]]>1];
    facsp[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facsp[n/d],Min@@#>=d&]],{d,Select[Divisors[n],ppQ]}]];
    Table[Length[facsp[n]],{n,100}]

A075802 Characteristic function of perfect powers, A001597.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 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, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 13 2002

Keywords

Comments

Not multiplicative: for example, a(8)=a(9)=1, but a(72)=0. - Franklin T. Adams-Watters, Sep 09 2005

Crossrefs

Programs

  • Haskell
    a075802 1 = 1
    a075802 n = signum $ a052409 n - 1  -- Reinhard Zumkeller, May 26 2012
    
  • Mathematica
    a[n_] := Boole[GCD @@ FactorInteger[n][[All, 2]] > 1]; a[1] = 1; Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Dec 12 2011 *)
  • Python
    from sympy import perfect_power
    def A075802(n): return int(bool(perfect_power(n))) if n>1 else 1 # Chai Wah Wu, Mar 11 2025

Formula

a(n) = A057427(A052409(n) - 1);
a(A001597(n))=1 and a(A007916(n))=0.

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

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

A025479 Largest exponents of perfect powers (A001597).

Original entry on oeis.org

2, 2, 3, 2, 4, 2, 3, 5, 2, 2, 6, 4, 2, 2, 3, 7, 2, 2, 2, 3, 2, 5, 8, 2, 2, 3, 2, 2, 2, 2, 9, 2, 2, 4, 2, 6, 2, 2, 2, 2, 3, 10, 2, 2, 2, 4, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 11, 2, 7, 3, 2, 2, 4, 2, 2, 2, 3, 2, 2, 2, 5, 2, 2, 2, 3, 2, 2, 2, 2, 2, 12, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 8, 2, 3, 2, 2, 2
Offset: 1

Views

Author

Keywords

Comments

Greatest common divisor of all prime-exponents in canonical factorization of n-th perfect power. - Reinhard Zumkeller, Oct 13 2002
Asymptotically, 100% of the terms are 2, since the density of cubes and higher powers among the squares and higher powers is 0. - Daniel Forgues, Jul 22 2014

Crossrefs

Programs

  • Haskell
    a025479 n = a025479_list !! (n-1)  -- a025479_list is defined in A001597.
    -- Reinhard Zumkeller, Mar 28 2014, Jul 15 2012
    
  • Maple
    N:= 10^6: # to get terms corresponding to all perfect powers <= N
    V:= Vector(N,storage=sparse);
    V[1]:= 2:
    for p from 2 to ilog2(N) do
      V[[seq(i^p,i=2..floor(N^(1/p)))]]:= p
    od:
    r,c,A := ArrayTools:-SearchArray(V):
    convert(A,list); # Robert Israel, Apr 25 2017
  • Mathematica
    Prepend[DeleteCases[#, 0], 2] &@ Table[If[Set[e, GCD @@ #[[All, -1]]] > 1, e, 0] &@ FactorInteger@ n, {n, 10^4}] (* Michael De Vlieger, Apr 25 2017 *)
  • PARI
    print1(2,", "); for(k=2, 3^8, if(j=ispower(k),print1(j,", "))) \\ Hugo Pfoertner, Jan 01 2019

Formula

a(n) = A052409(A001597(n)). - Reinhard Zumkeller, Oct 13 2002
A001597(n) = A025478(n)^a(n). - Reinhard Zumkeller, Mar 28 2014

Extensions

Definition corrected by Daniel Forgues, Mar 07 2009

A023057 (Apparently) not the difference between adjacent perfect powers (A001597, integers of form a^b, a >= 1, b >= 2).

Original entry on oeis.org

6, 14, 22, 29, 31, 34, 42, 44, 46, 50, 52, 54, 58, 62, 64, 66, 70, 72, 78, 82, 84, 86, 88, 90, 91, 96, 98, 102, 105, 110, 111, 114, 117, 118, 120, 122, 124, 126, 130, 132, 134, 136, 140, 142, 153, 156, 158, 160, 162, 164, 165, 172, 176, 177, 178, 179, 181, 182, 188, 190
Offset: 1

Views

Author

Keywords

Comments

Catalan's conjecture (now a theorem) is that 1 occurs just once as a difference, between 8 and 9.

References

  • G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.

Crossrefs

Cf. A001597 (perfect powers), A023055 (complement). See also A074980, A074981, A077286.

Programs

  • Mathematica
    pp = Union[ Join[{1}, Flatten[ Table[n^i, {n, 2, Sqrt[10^12]}, {i, 2, Log[n, 10^12]}]]]]; l = Length[pp]; d = Sort[Take[pp, -l + 1] - Take[pp, l - 1]]; Complement[ Table[i, {i, 1, 200}], Take[ Union[d], 200]] (* Robert G. Wilson v *)

A175064 a(1) = 1; for n >= 2, a(n) = number of ways h to write the n-th perfect power A001597(n) as m^k with m >= 2 and k >= 1.

Original entry on oeis.org

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

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

Perfect powers with first occurrence of h >= 2: 4, 16, 64, 65536, 4096, ... [The perfect power corresponding to h is A175065(h) = 2^A005179(h). - Jianing Song, Oct 27 2024]

Examples

			For n = 11: A001597(11) = 64; there are 4 ways to write 64 as m^k: 64^1 = 8^2 = 4^3 = 2^6.
		

Crossrefs

Programs

  • Python
    from math import gcd
    from sympy import mobius, integer_nthroot, divisor_count, factorint
    def A175064(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 divisor_count(gcd(*factorint(kmax).values())) # Chai Wah Wu, Aug 13 2024

Formula

a(n) = A000005(A253641(A001597(n))) = A253642(n)+1. - M. F. Hasler, Jan 25 2015

Extensions

Extended by T. D. Noe, Apr 21 2011
Definition clarified by Jonathan Sondow, Nov 30 2012
Showing 1-10 of 694 results. Next