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

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
    

A377434 Numbers k such that there is a unique perfect-power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

2, 6, 15, 18, 22, 25, 31, 34, 39, 44, 47, 48, 53, 54, 61, 66, 68, 72, 78, 85, 92, 97, 99, 105, 114, 122, 129, 137, 146, 154, 162, 168, 172, 181, 191, 200, 210, 217, 219, 228, 240, 251, 263, 269, 274, 283, 295, 306, 309, 319, 329, 342, 357, 367, 378, 393, 400
Offset: 1

Views

Author

Gus Wiseman, Nov 02 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.

Examples

			Primes 4 and 5 are 7 and 11, and the interval (8,9,10) contains two perfect-powers (8,9), so 4 is not in the sequence.
Primes 5 and 6 are 11 and 13, and the interval (12) contains no perfect-powers, so 5 is not in the sequence.
Primes 6 and 7 are 13 and 17, and the interval (14,15,16) contains just one perfect-power (16), so 6 is in the sequence.
		

Crossrefs

For powers of 2 instead of primes see A013597, A014210, A014234, A244508, A377467.
For prime-powers we have A377287.
For squarefree numbers see A377430, A061398, A377431, A068360.
These are the positions of 1 in A377432.
For no perfect-powers we have A377436.
For more than one perfect-power we have A377466.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A031218 gives the greatest prime-power <= n.
A046933 counts the interval from A008864(n) to A006093(n+1).
A065514 gives the greatest prime-power < prime(n), difference A377289.
A081676 gives the greatest perfect-power <= n.
A131605 lists perfect-powers that are not prime-powers.
A345531 gives the least prime-power > prime(n), difference A377281.
A366833 counts prime-powers between primes, see A053607, A304521.
A377468 gives the least perfect-power > n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[100],Length[Select[Range[Prime[#]+1,Prime[#+1]-1],perpowQ]]==1&]

A377466 Numbers k such that there is more than one perfect power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

4, 9, 11, 30, 327, 445, 3512, 7789, 9361, 26519413
Offset: 1

Views

Author

Gus Wiseman, Nov 02 2024

Keywords

Comments

Perfect powers (A001597) are numbers with a proper integer root, the complement of A007916.
Is this sequence finite?
The Redmond-Sun conjecture (see A308658) implies that this sequence is finite. - Pontus von Brömssen, Nov 05 2024

Examples

			Primes 9 and 10 are 23 and 29, and the interval (24,25,26,27,28) contains two perfect powers (25,27), so 9 is in the sequence.
		

Crossrefs

For powers of 2 see A013597, A014210, A014234, A188951, A244508, A377467.
For no prime-powers we have A377286, ones in A080101.
For a unique prime-power we have A377287.
For squarefree numbers see A377430, A061398, A377431, A068360, A224363.
These are the positions of terms > 1 in A377432.
For a unique perfect power we have A377434.
For no perfect powers we have A377436.
A000015 gives the least prime power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A046933 counts the interval from A008864(n) to A006093(n+1).
A081676 gives the greatest perfect power <= n.
A131605 lists perfect powers that are not prime-powers.
A246655 lists the prime-powers not including 1, complement A361102.
A366833 counts prime-powers between primes, see A053607, A304521.
A377468 gives the least perfect power > n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[100],Count[Range[Prime[#]+1, Prime[#+1]-1],_?perpowQ]>1&]
  • Python
    from itertools import islice
    from sympy import prime
    from gmpy2 import is_power, next_prime
    def A377466_gen(startvalue=1): # generator of terms >= startvalue
        k = max(startvalue,1)
        p = prime(k)
        while (q:=next_prime(p)):
            c = 0
            for i in range(p+1,q):
                if is_power(i):
                    c += 1
                    if c>1:
                        yield k
                        break
            k += 1
            p = q
    A377466_list = list(islice(A377466_gen(),9)) # Chai Wah Wu, Nov 04 2024

Formula

a(n) = A000720(A116086(n)) = A000720(A116455(n)) for n <= 10. This would hold for all n if there do not exist more than two perfect powers between any two consecutive primes, which is implied by the Redmond-Sun conjecture. - Pontus von Brömssen, Nov 05 2024

Extensions

a(10) from Pontus von Brömssen, Nov 04 2024

A376561 Points of downward concavity in the sequence of perfect-powers (A001597).

Original entry on oeis.org

2, 5, 7, 13, 14, 18, 19, 21, 24, 25, 29, 30, 39, 40, 45, 51, 52, 56, 59, 66, 70, 71, 74, 87, 94, 101, 102, 108, 110, 112, 113, 119, 127, 135, 143, 144, 156, 157, 160, 161, 169, 178, 187, 196, 205, 206, 215, 224, 225, 234, 244, 263, 273, 283, 284, 293, 294, 304
Offset: 1

Views

Author

Gus Wiseman, Sep 30 2024

Keywords

Comments

These are points at which the second differences are negative.
Perfect-powers (A001597) are numbers with a proper integer root.
Note that, for some sources, downward concavity is positive curvature.
From Robert Israel, Oct 31 2024: (Start)
The first case of two consecutive numbers in the sequence is a(4) = 13 and a(5) = 14.
The first case of three consecutive numbers is a(293) = 2735, a(294) = 2736, a(295) = 2737.
The first case of four consecutive numbers, if it exists, involves a(k) with k > 69755. (End)

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, 33, ...
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, 2, ...
with negative positions (A376561):
  2, 5, 7, 13, 14, 18, 19, 21, 24, 25, 29, 30, 39, 40, 45, 51, 52, 56, 59, 66, 70, ...
		

Crossrefs

The version for A000002 is A025505, complement A022297. See also A054354, A376604.
For first differences we have A053289, union A023055, firsts A376268, A376519.
For primes instead of perfect-powers we have A258026.
For upward concavity we have A376560 (probably the complement).
A000961 lists the prime-powers inclusive, exclusive A246655.
A001597 lists the perfect-powers.
A007916 lists the non-perfect-powers.
A112344 counts partitions into perfect-powers, factorizations A294068.
A333254 gives run-lengths of differences between consecutive primes.
Second differences: A036263 (prime), A073445 (composite), A376559 (perfect-power), A376562 (non-perfect-power), A376590 (squarefree), A376593 (nonsquarefree), A376596 (prime-power), A376599 (non-prime-power).

Programs

  • Maple
    N:= 10^6: # to use perfect powers <= N
    P:= {seq(seq(i^m,i=2..floor(N^(1/m))), m=2 .. ilog2(N))}: nP:= nops(P):
    P:= sort(convert(P,list)):
    select(i -> 2*P[i] > P[i-1]+P[i+1], [$2..nP-1]); # Robert Israel, Oct 31 2024
  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Join@@Position[Sign[Differences[Select[Range[1000],perpowQ],2]],-1]

A378374 Perfect powers p such that the interval from the previous perfect power to p contains a unique prime.

Original entry on oeis.org

128, 225, 256, 64009, 1295044
Offset: 1

Views

Author

Gus Wiseman, Dec 17 2024

Keywords

Comments

Also numbers appearing exactly once in A378249.

Examples

			The consecutive perfect powers 125 and 128 have interval (125, 126, 127, 128) with unique prime 127, so 128 is in the sequence.
		

Crossrefs

The previous prime is A178700.
For prime powers instead of perfect powers we have A345531, difference A377281.
Opposite singletons in A378035 (union A378253), restriction of A081676.
For squarefree numbers we have A378082, see A377430, A061398, A377431, A068360.
Singletons in A378249 (run-lengths A378251), restriction of A377468 to the primes.
If the same interval contains at least one prime we get A378250.
For next instead of previous perfect power we have A378355.
Swapping "prime" with "perfect power" gives A378364.
A000040 lists the primes, differences A001223.
A001597 lists the perfect powers, differences A053289.
A007916 lists the non perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A080769 counts primes between perfect powers.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    y=Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,1000}];
    Select[Union[y],Count[y,#]==1&]

Formula

We have a(n) < A178700(n) < A378355(n).

A378364 Prime numbers such that the interval from the previous prime number contains a unique perfect power.

Original entry on oeis.org

2, 5, 17, 53, 67, 83, 101, 131, 149, 173, 197, 223, 227, 251, 257, 293, 331, 347, 367, 401, 443, 487, 521, 541, 577, 631, 677, 733, 787, 853, 907, 967, 1009, 1031, 1091, 1163, 1229, 1297, 1361, 1373, 1447, 1523, 1601, 1693, 1733, 1777, 1861, 1949, 2027, 2053
Offset: 1

Views

Author

Gus Wiseman, Dec 16 2024

Keywords

Comments

Perfect-powers (A001597) are 1 and numbers with a proper integer root.

Examples

			The prime before 17 is 13, and the interval (13,14,15,16,17) contains only one perfect power 16, so 17 is in the sequence.
The prime before 29 is 23, and the interval (23,24,25,26,27,28,29) contains two perfect powers 25 and 27, so 29 is not in the sequence.
		

Crossrefs

For non prime powers we have A006512.
For zero instead of one perfect power we have the prime terms of A345531.
The indices of these primes are the positions of 1 in A377432.
The indices of these primes are 1 + A377434(n-1).
For more than one perfect power see A377466.
Swapping "prime" with "perfect power" gives A378374.
For next instead of previous prime we have A379154.
A000040 lists the primes, differences A001223.
A001597 lists the perfect powers, differences A053289.
A007916 lists the non perfect powers, differences A375706.
A081676 gives the greatest perfect power <= n.
A377468 gives the least perfect power > n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[1000],PrimeQ[#]&&Length[Select[Range[NextPrime[#,-1],#],perpowQ]]==1&]

A379154 Prime numbers p such that the interval from p to the next prime number contains a unique perfect power.

Original entry on oeis.org

3, 13, 47, 61, 79, 97, 127, 139, 167, 193, 211, 223, 241, 251, 283, 317, 337, 359, 397, 439, 479, 509, 523, 571, 619, 673, 727, 773, 839, 887, 953, 997, 1021, 1087, 1153, 1223, 1291, 1327, 1367, 1439, 1511, 1597, 1669, 1723, 1759, 1847, 1933, 2017, 2039, 2113
Offset: 1

Views

Author

Gus Wiseman, Dec 18 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root.

Examples

			The prime after 13 is 17, and the interval (13,14,15,16,17) contains only one perfect power 16, so 13 is in the sequence.
		

Crossrefs

The indices of these primes are one plus the positions of 1 in A377432.
For zero instead of one perfect power we have the primes indexed by A377436.
The indices of these primes are A377434.
Swapping "prime" with "perfect power" gives A378355, indices A378368.
For previous instead of next prime we have A378364.
A000040 lists the primes, differences A001223.
A001597 lists the perfect powers, differences A053289.
A007916 lists the non perfect powers, differences A375706.
A081676 gives the greatest perfect power <= n.
A116086 gives perfect powers with no primes between them and the next perfect power.
A366833 counts prime powers between primes, see A053607, A304521.
A377468 gives the least perfect power > n.

Programs

  • Maple
    N:= 10^4: # to get all entries <= N
    S:={seq(seq(a^b, b = 2 .. floor(log[a](N))), a = 2 .. floor(sqrt(N)))}:
    S:= sort(convert(S,list)):
    J:= select(i -> nextprime(S[i]) < S[i+1] and prevprime(S[i]) > S[i-1], [$2..nops(S)-1]):
    J:= [1,op(J)]:
    map(prevprime, S[J]); # Robert Israel, Jan 19 2025
  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Select[Range[1000],PrimeQ[#]&&Length[Select[Range[#,NextPrime[#]],perpowQ]]==1&]
  • PARI
    is_a379154(n) = isprime(n) && #select(x->ispower(x), [n+1..nextprime(n+1)-1])==1 \\ Hugo Pfoertner, Dec 19 2024

Formula

a(n) = A151799(A378364(n+1)).

A377044 The n-th perfect-power A001597(n) minus the n-th prime-power A246655(n).

Original entry on oeis.org

-1, 1, 4, 4, 9, 17, 18, 21, 23, 33, 47, 62, 77, 96, 98, 99, 113, 137, 159, 175, 182, 196, 207, 236, 265, 282, 297, 333, 370, 411, 433, 448, 493, 536, 579, 628, 681, 734, 791, 848, 879, 899, 962, 1028, 1094, 1159, 1192, 1220, 1293, 1364, 1437, 1514, 1559, 1591
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root.

Crossrefs

Including 1 with the prime-powers gives A377043.
A000015 gives the least prime-power >= n.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, A093555, A376596.
A001597 lists the perfect-powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A025475 lists numbers that are both a perfect-power and a prime-power.
A031218 gives the greatest prime-power <= n.
A080101 counts prime-powers between primes (exclusive).
A106543 lists numbers that are neither a perfect-power nor a prime-power.
A131605 lists perfect-powers that are not prime-powers.
A246655 lists the prime-powers, complement A361102, A375708.
Prime-power runs: A373675, min A373673, max A373674, length A174965.
Prime-power antiruns: A373576, min A120430, max A006549, length A373671.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    per=Select[Range[1000],perpowQ];
    per-NestList[NestWhile[#+1&, #+1,!PrimePowerQ[#]&]&,2,Length[per]-1]
  • Python
    from sympy import mobius, primepi, integer_nthroot
    def A377044(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())))
        def g(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        return bisection(f,n,n)-bisection(g,n,n) # Chai Wah Wu, Oct 27 2024

Formula

a(n) = A001597(n) - A246655(n).
Showing 1-9 of 9 results.