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

A286708 Powerful numbers (A001694) that are not prime powers (A000961).

Original entry on oeis.org

36, 72, 100, 108, 144, 196, 200, 216, 225, 288, 324, 392, 400, 432, 441, 484, 500, 576, 648, 675, 676, 784, 800, 864, 900, 968, 972, 1000, 1089, 1125, 1152, 1156, 1225, 1296, 1323, 1352, 1372, 1444, 1521, 1568, 1600, 1728, 1764, 1800, 1936, 1944, 2000, 2025, 2116, 2304, 2312, 2500, 2592, 2601, 2700, 2704, 2744
Offset: 1

Views

Author

Ilya Gutkovskiy, May 13 2017

Keywords

Comments

If a prime p divides a(n) then p^2 must also divide a(n) and number of distinct primes dividing a(n) > 1.
Intersection of A001694 and A024619.

Examples

			-------------------------------
| n | a(n) | prime            |
|   |      | factorization    |
|------------------------------
| 1 | 36   | {{2, 2}, {3, 2}} |
| 2 | 72   | {{2, 3}, {3, 2}} |
| 3 | 100  | {{2, 2}, {5, 2}} |
| 4 | 108  | {{2, 2}, {3, 3}} |
| 5 | 144  | {{2, 4}, {3, 2}} |
| 6 | 196  | {{2, 2}, {7, 2}} |
| 7 | 200  | {{2, 3}, {5, 2}} |
| 8 | 216  | {{2, 3}, {3, 3}} |
| 9 | 225  | {{3, 2}, {5, 2}} |
-------------------------------
a(n) = p_1^e_1*p_2^e_2*... : {{p_1, e_1}, {p_2, e_2}, ...}.
		

Crossrefs

Programs

  • Maple
    N:= 10000:
    S:= {1}: P:= {1}:
    p:= 1:
    do
      p:= nextprime(p);
      if p^2 > N then break fi;
      S:= map(s -> (s, seq(s*p^k, k = 2 .. floor(log[p](N/s)))), S);
      P:= P union {seq(p^k, k=2..floor(log[p](N)))}:
    od:
    sort(convert(S minus P, list)); # Robert Israel, May 14 2017
  • Mathematica
    Select[Range@2750, Min@FactorInteger[#][[All, 2]] > 1 && ! PrimePowerQ[#] &]
    (* Second program *)
    nn = 2^25; Select[Rest@ Union@ Flatten@ Table[a^2*b^3, {b, nn^(1/3)}, {a, Sqrt[nn/b^3]}], ! PrimePowerQ[#] &] (* Michael De Vlieger, Jun 22 2022 *)
  • Python
    from sympy import primefactors, factorint
    print([n for n in range(4,2745) if len(primefactors(n)) > 1 and min(list(factorint(n).values())) > 1]) # Karl-Heinz Hofmann, Feb 07 2023
    
  • Python
    from math import isqrt
    from sympy import integer_nthroot, primepi, mobius
    def A286708(n):
        def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
        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):
            c, l = n+x, 0
            j = isqrt(x)
            while j>1:
                k2 = integer_nthroot(x//j**2,3)[0]+1
                w = squarefreepi(k2-1)
                c -= j*(w-l)
                l, j = w, isqrt(x//k2**3)
            c -= squarefreepi(integer_nthroot(x,3)[0])-l
            return c+1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(2, x.bit_length()))
        return bisection(f,n,n) # Chai Wah Wu, Sep 10 2024

Formula

Sum_{n>=1} 1/a(n) = zeta(2)*zeta(3)/zeta(6) - Sum_{p prime} 1/(p*(p-1)) - 1 = A082695 - A136141 - 1 = 0.17043976777096407719... - Amiram Eldar, Feb 12 2021

A377468 Least perfect-power >= n.

Original entry on oeis.org

1, 4, 4, 4, 8, 8, 8, 8, 9, 16, 16, 16, 16, 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 32, 32, 32, 32, 32, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81
Offset: 1

Views

Author

Gus Wiseman, Nov 05 2024

Keywords

Comments

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

Crossrefs

The version for prime-powers is A000015.
The union is A001597 (perfect-powers), without powers of two A377702.
Positions of last appearances are also A001597.
The version for primes is A007918 or A151800.
The version for squarefree numbers is A067535.
Run-lengths are A076412.
The opposite version (greatest perfect-power <= n) is A081676.
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.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
A377432 counts perfect-powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#+1&,n,#>1&&!perpowQ[#]&],{n,100}]
  • Python
    from sympy import mobius, integer_nthroot
    def A377468(n):
        if n == 1: return 1
        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(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        m = n-f(n-1)
        return bisection(lambda x:f(x)+m,n-1,n) # Chai Wah Wu, Nov 05 2024

Formula

Positions of first appearances for n > 2 are A216765(n-2) = A001597(n-1) + 1.

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

A377283 Nonnegative integers k such that either k = 0 or there is a perfect power x in the range prime(k) < x < prime(k+1).

Original entry on oeis.org

0, 2, 4, 6, 9, 11, 15, 18, 22, 25, 30, 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, 327, 329, 342, 357
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2024

Keywords

Comments

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

Examples

			The first number-line below shows the perfect powers. The second shows each positive integer k at position prime(k).
-1-----4-------8-9------------16----------------25--27--------32------36----
===1=2===3===4=======5===6=======7===8=======9==========10==11==========12==
		

Crossrefs

A version for prime powers is A377057, exclusive A377287.
A version for squarefree numbers is A377431.
Positions of positive terms in A377432 (counts perfect powers between primes).
The case of a unique choice is A377434 (a subset).
The complement (no choices) is A377436.
The case of at least two choices is A377466 (a subset).
Positions of last appearances in A378249.
First-differences are A378251.
This is A378365 - 1, union of A378356 - 1.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
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.
A131605 lists perfect powers that are not prime powers.

Programs

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

A378035 Greatest perfect power < prime(n).

Original entry on oeis.org

1, 1, 4, 4, 9, 9, 16, 16, 16, 27, 27, 36, 36, 36, 36, 49, 49, 49, 64, 64, 64, 64, 81, 81, 81, 100, 100, 100, 100, 100, 125, 128, 128, 128, 144, 144, 144, 144, 144, 169, 169, 169, 169, 169, 196, 196, 196, 216, 225, 225, 225, 225, 225, 243, 256, 256, 256, 256
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2024

Keywords

Comments

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

Examples

			The first number line below shows the perfect powers.
The second shows each positive integer k at position prime(k).
-1-----4-------8-9------------16----------------25--27--------32------36----
===1=2===3===4=======5===6=======7===8=======9==========10==11==========12==
		

Crossrefs

Restriction of A081676 to the primes.
Positions of last appearances are also A377283.
A version for squarefree numbers is A378032.
The opposite is A378249 (run lengths A378251), restriction of A377468 to the primes.
The union is A378253.
Terms appearing exactly once are A378355.
Run lengths are A378356, first differences of A377283, complement A377436.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289.
A007916 lists the nonperfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A080769 counts primes between perfect powers, prime powers A067871.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, zeros A377436, postpositives A377466.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Table[NestWhile[#-1&,Prime[n],radQ[#]&],{n,100}]
  • PARI
    a(n) = my(k=prime(n)-1); while (!(ispower(k) || (k==1)), k--); k; \\ Michel Marcus, Nov 25 2024
    
  • Python
    from sympy import mobius, integer_nthroot, prime
    def A378035(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(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        m = (p:=prime(n)-1)-f(p)
        return bisection(lambda x:f(x)+m,m,m) # Chai Wah Wu, Nov 25 2024

A378249 Least perfect power > prime(n).

Original entry on oeis.org

4, 4, 8, 8, 16, 16, 25, 25, 25, 32, 32, 49, 49, 49, 49, 64, 64, 64, 81, 81, 81, 81, 100, 100, 100, 121, 121, 121, 121, 121, 128, 144, 144, 144, 169, 169, 169, 169, 169, 196, 196, 196, 196, 196, 216, 216, 216, 225, 243, 243, 243, 243, 243, 256, 289, 289, 289
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.
Which terms appear only once? Just 128, 225, 256, 64009, 1295044?

Examples

			The first number line below shows the perfect powers. The second shows each prime.
-1-----4-------8-9------------16----------------25--27--------32------36------------------------49--
===2=3===5===7======11==13======17==19======23==========29==31==========37======41==43======47======
		

Crossrefs

A version for prime powers (but starting with prime(k) + 1) is A345531.
Positions of last appearances are A377283, complement A377436.
Restriction of A377468 to the primes, for prime powers A000015.
The opposite is A378035, restriction of A081676.
The union is A378250.
Run lengths are A378251.
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 numbers that are not perfect powers, differences A375706, seconds A376562.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, zeros A377436, postpositives A377466.

Programs

  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,100}]
  • PARI
    f(p) = p++; while(!ispower(p), p++); p;
    lista(nn) = apply(f, primes(nn)); \\ Michel Marcus, Dec 19 2024

A378251 Number of primes between consecutive perfect powers, zeros omitted.

Original entry on oeis.org

2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 1, 3, 5, 5, 3, 1, 5, 1, 7, 5, 2, 4, 6, 7, 7, 5, 2, 6, 9, 8, 7, 8, 9, 8, 8, 6, 4, 9, 10, 9, 10, 7, 2, 9, 12, 11, 12, 6, 5, 9, 12, 11, 3, 10, 8, 2, 13, 15, 10, 11, 15, 7, 9, 12, 13, 11, 12, 17, 2, 11, 16, 16, 13, 17, 15, 14, 16, 15
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2024

Keywords

Comments

First differences of A377283 and A378365. Run-lengths of A378035 and A378249.
Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			The first number line below shows the perfect powers. The second shows each prime. To get a(n) we count the primes between consecutive perfect powers, skipping the cases where there are none.
-1-----4-------8-9------------16----------------25--27--------32------36----
===2=3===5===7======11==13======17==19======23==========29==31==========37==
		

Crossrefs

Same as A080769 with 0's removed (which were at positions A274605).
First differences of A377283 and A378365 (union of A378356).
Run-lengths of A378035 (union A378253) and A378249 (union A378250).
The version for nonprime prime powers is A378373, with zeros A067871.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect powers, differences A053289, run-lengths of A377468.
A007916 lists the non-perfect powers, differences A375706.
A069623 counts perfect powers <= n.
A076411 counts perfect powers < n.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.

Programs

  • Maple
    N:= 10^6: # to use perfect powers up to N
    PP:= {1,seq(seq(i^j,j=2..ilog[i](N)),i=2..isqrt(N))}:
    PP:= sort(convert(PP,list)):
    M:= map(numtheory:-pi, PP):
    subs(0=NULL, M[2..-1]-M[1..-2]): # Robert Israel, Jan 23 2025
  • Mathematica
    radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
    Length/@Split[Table[NestWhile[#+1&,Prime[n],radQ[#]&],{n,100}]]

A378250 Perfect-powers x > 1 such that it is not possible to choose a prime y and a perfect-power z satisfying x > y > z.

Original entry on oeis.org

4, 8, 16, 25, 32, 49, 64, 81, 100, 121, 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, 1849, 1936
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2024

Keywords

Comments

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

Examples

			The first number line below shows the perfect-powers. The second shows the primes. The third is a(n).
-1-----4-------8-9------------16----------------25--27--------32------36----
===2=3===5===7======11==13======17==19======23==========29==31==========37==
       4       8              16                25            32
The terms together with their prime indices begin:
     4: {1,1}
     8: {1,1,1}
    16: {1,1,1,1}
    25: {3,3}
    32: {1,1,1,1,1}
    49: {4,4}
    64: {1,1,1,1,1,1}
    81: {2,2,2,2}
   100: {1,1,3,3}
   121: {5,5}
   128: {1,1,1,1,1,1,1}
   144: {1,1,1,1,2,2}
   169: {6,6}
   196: {1,1,4,4}
   216: {1,1,1,2,2,2}
   225: {2,2,3,3}
   243: {2,2,2,2,2}
   256: {1,1,1,1,1,1,1,1}
		

Crossrefs

A version for prime-powers (but starting with prime(k) + 1) is A345531.
The opposite is union of A378035, restriction of A081676.
Union of A378249, run-lengths are A378251.
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.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
A377432 counts perfect-powers between primes, zeros A377436, positive A377283, postpositive A377466.

Programs

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

A074984 m^p-n, for smallest m^p>=n.

Original entry on oeis.org

0, 2, 1, 0, 3, 2, 1, 0, 0, 6, 5, 4, 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 0, 4, 3, 2, 1, 0, 3, 2, 1, 0, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8
Offset: 1

Views

Author

Zak Seidov, Oct 07 2002

Keywords

Comments

a(n) = 0 if n = m^p that is if n is a full power (square, cube etc.).
This is the distance between n and the next perfect power. The previous perfect power is A081676, which differs from n by A069584. After a(8) = a(9) this sequence is an anti-run (no adjacent equal terms). - Gus Wiseman, Dec 02 2024

Crossrefs

Sequences obtained by subtracting n from each term are placed in parentheses below.
Positions of 0 are A001597.
Positions of 1 are A375704.
The version for primes is A007920 (A007918).
The opposite (greatest perfect power <= n) is A069584 (A081676).
The version for perfect powers is A074984 (this) (A377468).
The version for squarefree numbers is A081221 (A067535).
The version for non perfect powers is A378357 (A378358).
The version for nonsquarefree numbers is A378369 (A120327).
The version for prime powers is A378370 (A000015).
The version for non prime powers is A378371 (A378372).
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.
A131605 lists perfect powers that are not prime powers.
A377432 counts perfect powers between primes, zeros A377436.

Programs

  • Mathematica
    powerQ[n_] := GCD @@ FactorInteger[n][[All, 2]] > 1; powerQ[1] = True; a[n_] := For[k = n, True, k++, If[powerQ[k], Return[k-n]]]; Table[a[n], {n, 1, 92}] (* Jean-François Alcover, Apr 19 2013 *)
  • PARI
    a(n) = { if (n==1, return (0)); my(nn = n); while(! ispower(nn), nn++); return (nn - n);} \\ Michel Marcus, Apr 19 2013

Formula

a(n) = A377468(n) - n. - Gus Wiseman, Dec 02 2024
Showing 1-10 of 39 results. Next