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.

Previous Showing 11-17 of 17 results.

A378358 Least non-perfect-power >= n.

Original entry on oeis.org

2, 2, 3, 5, 5, 6, 7, 10, 10, 10, 11, 12, 13, 14, 15, 17, 17, 18, 19, 20, 21, 22, 23, 24, 26, 26, 28, 28, 29, 30, 31, 33, 33, 34, 35, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 65, 66, 67
Offset: 1

Views

Author

Gus Wiseman, Nov 24 2024

Keywords

Comments

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

Crossrefs

The version for prime-powers is A000015, for non-prime-powers A378372.
The union is A007916, complement A001597.
The version for nonsquarefree numbers is A067535, negative A120327 (subtract A378369).
The version for composite numbers is A113646.
The version for prime numbers is A159477.
The run-lengths are A375706.
Terms appearing only once are A375738, multiple times A375703.
The version for perfect-powers is A377468.
Subtracting from n gives A378357.
The opposite version is A378363, for perfect-powers A081676.
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.
A377432 counts perfect-powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#+1&,n,perpowQ[#]&],{n,100}]
  • Python
    from sympy import mobius, integer_nthroot
    def A378358(n):
        def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        a = max(1,n-f(n-1))
        m, k = a, f(a)+a
        while m != k: m, k = k, f(k)+a
        return m # Chai Wah Wu, Nov 26 2024
    
  • Python
    from sympy import perfect_power
    def A378358(n): return n if n>1 and perfect_power(n)==False else n+1 if perfect_power(n+1)==False else n+2 # Chai Wah Wu, Nov 27 2024

Formula

a(n) = n - A378357(n).

A378363 Greatest number <= n that is 1 or not a perfect-power.

Original entry on oeis.org

1, 2, 3, 3, 5, 6, 7, 7, 7, 10, 11, 12, 13, 14, 15, 15, 17, 18, 19, 20, 21, 22, 23, 24, 24, 26, 26, 28, 29, 30, 31, 31, 33, 34, 35, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 63, 65, 66, 67
Offset: 1

Views

Author

Gus Wiseman, Nov 24 2024

Keywords

Comments

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

Examples

			In the non-perfect-powers ... 5, 6, 7, 10, 11 ... the greatest term <= 8 is 7, so a(8) = 7.
		

Crossrefs

The union is A007916, complement A001597.
The version for prime numbers is A007917 or A151799, opposite A159477.
The version for prime-powers is A031218, opposite A000015.
The version for squarefree numbers is A067535, opposite A070321.
The version for perfect-powers is A081676, opposite A377468.
The version for composite numbers is A179278, opposite A113646.
Terms appearing multiple times are A375704, opposite A375703.
The run-lengths are A375706.
Terms appearing only once are A375739, opposite A375738.
The version for nonsquarefree numbers is A378033, opposite A120327.
The opposite version is A378358.
Subtracting n gives A378364, opposite A378357.
The version for non-prime-powers is A378367 (subtracted A378371), opposite A378372.
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.
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 A378363(n):
        def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        a = n-f(n)
        m, k = a, f(a)+a
        while m != k: m, k = k, f(k)+a
        return m # Chai Wah Wu, Nov 26 2024

A378253 Perfect powers p such that there are no other perfect powers between p and the least prime > p.

Original entry on oeis.org

1, 4, 9, 16, 27, 36, 49, 64, 81, 100, 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, 1849
Offset: 1

Views

Author

Gus Wiseman, Nov 26 2024

Keywords

Comments

Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.
Each term is the greatest perfect power < prime(k) for some k.

Examples

			The first number line below shows the perfect powers. The second shows each prime. To get a(n), we take the last perfect power in each interval between consecutive primes, omitting 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

Union of A378035, restriction of A081676 to the primes.
The opposite is A378250, union of A378249 (run-lengths A378251).
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.
A377283 ranks perfect powers between primes, differences A378356.
A377432 counts perfect powers between primes, see A377434, A377436, A377466.

Programs

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

A377702 Perfect-powers except for powers of 2.

Original entry on oeis.org

9, 25, 27, 36, 49, 81, 100, 121, 125, 144, 169, 196, 216, 225, 243, 289, 324, 343, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849, 1936, 2025, 2116, 2187, 2197
Offset: 1

Views

Author

Gus Wiseman, Nov 05 2024

Keywords

Comments

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

Examples

			The terms together with their prime indices begin:
     9: {2,2}
    25: {3,3}
    27: {2,2,2}
    36: {1,1,2,2}
    49: {4,4}
    81: {2,2,2,2}
   100: {1,1,3,3}
   121: {5,5}
   125: {3,3,3}
   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}
   289: {7,7}
   324: {1,1,2,2,2,2}
		

Crossrefs

Including the powers of 2 gives A001597, counted by A377435.
For prime-powers we have A061345.
These terms are counted by A377467, for non-perfect-powers A377701.
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.
A081676 gives the greatest perfect-power <= n.
A131605 lists perfect-powers that are not prime-powers.
A188951 counts perfect-powers less than 2^n.
A377468 gives the least perfect-power > n.

Programs

  • Mathematica
    Select[Range[1000],GCD@@FactorInteger[#][[All,2]]>1&&!IntegerQ[Log[2,#]]&]
  • Python
    from sympy import mobius, integer_nthroot
    def A377702(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-2+x+(l:=x.bit_length())+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,l)))
        return bisection(f,n+1,n+1) # Chai Wah Wu, Nov 06 2024

A070228 Number of perfect powers (A001597) not exceeding 2^n.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 11, 16, 23, 31, 42, 58, 82, 114, 156, 217, 299, 417, 583, 814, 1136, 1589, 2224, 3116, 4369, 6136, 8623, 12128, 17064, 24023, 33839, 47689, 67227, 94805, 133738, 188710, 266351, 376019, 530941, 749820, 1059097, 1496144, 2113802, 2986770, 4220666
Offset: 0

Views

Author

Donald S. McDonald, May 14 2002

Keywords

Examples

			How many powers are there not exceeding 2^4?: 1, 4, 8, 9, 16. Hence a(4) = 5.
a(22)=2224: there are 2224 powers not exceeding 2^22.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := 1 - Sum[ MoebiusMu[x]*Floor[2^(n/x) - 1], {x, 2, n}]; Array[f, 44, 0] (* Robert G. Wilson v, Jan 20 2015 *)
  • PARI
    a(n) = 1 - sum(k=2, n, moebius(k)*(sqrtnint(2^n,k)-1));
    
  • Python
    from sympy import mobius, integer_nthroot
    def A070228(n): return int(1+sum(mobius(x)*(1-integer_nthroot(1<Chai Wah Wu, Aug 13 2024

Formula

a(n) = 1 - Sum_{k=2..n} Moebius(k)*floor(2^(n/k)-1). - Robert G. Wilson v, Jan 20 2015
a(n) = A188951(n) + 1 for n > 1. - Amiram Eldar, May 19 2022

Extensions

a(39)-a(44) from Alex Ratushnyak, Jan 02 2014

A377435 Number of perfect-powers x in the range 2^n <= x < 2^(n+1).

Original entry on oeis.org

1, 0, 1, 2, 3, 3, 5, 7, 8, 11, 16, 24, 32, 42, 61, 82, 118, 166, 231, 322, 453, 635, 892, 1253, 1767, 2487, 3505, 4936, 6959, 9816, 13850, 19538, 27578, 38933, 54972, 77641, 109668, 154922, 218879, 309277, 437047, 617658, 872968, 1233896, 1744153, 2465547, 3485478
Offset: 0

Views

Author

Gus Wiseman, Nov 04 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.
Also the number of perfect-powers with n bits.

Examples

			The perfect-powers in each prescribed range (rows):
    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
Their binary expansions (columns):
  1  .  100  1000  10000  100000  1000000  10000000  100000000
             1001  11001  100100  1010001  10010000  100100001
                   11011  110001  1100100  10101001  101000100
                                  1111001  11000100  101010111
                                  1111101  11011000  101101001
                                           11100001  110010000
                                           11110011  110111001
                                                     111100100
		

Crossrefs

The union of all numbers counted is A001597, without powers of two A377702.
The version for squarefree numbers is A077643.
These are the first differences of A188951.
The version for prime-powers is A244508.
For primes instead of powers of 2 we have A377432, zeros A377436.
Not counting powers of 2 gives A377467.
The version for non-perfect-powers is A377701.
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.
A081676 gives the greatest perfect-power <= n.
A131605 lists perfect-powers that are not prime-powers.
A377468 gives the least perfect-power > n.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[Length[Select[Range[2^n,2^(n+1)-1],perpowQ]],{n,0,15}]
  • Python
    from sympy import mobius, integer_nthroot
    def A377435(n):
        if n==0: return 1
        def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        return f((1<Chai Wah Wu, Nov 05 2024

Formula

For n != 1, a(n) = A377467(n) + 1.

Extensions

a(26)-a(46) from Chai Wah Wu, Nov 05 2024

A378617 First differences of A378249 (next perfect power after prime(n)).

Original entry on oeis.org

0, 4, 0, 8, 0, 9, 0, 0, 7, 0, 17, 0, 0, 0, 15, 0, 0, 17, 0, 0, 0, 19, 0, 0, 21, 0, 0, 0, 0, 7, 16, 0, 0, 25, 0, 0, 0, 0, 27, 0, 0, 0, 0, 20, 0, 0, 9, 18, 0, 0, 0, 0, 13, 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 19, 0, 18, 0, 0, 0, 39, 0, 0, 0, 0, 0, 41, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Dec 09 2024

Keywords

Comments

This is the next perfect power after prime(n+1), minus the next perfect power after prime(n).
Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Crossrefs

Positions of positives are A377283.
Positions of zeros are A377436.
The restriction to primes has first differences A377468.
A version for nonsquarefree numbers is A377784, differences of A377783.
The opposite is differences of A378035 (restriction of A081676).
First differences of A378249, run-lengths A378251.
Without zeros we have differences of A378250.
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.
A377432 counts perfect powers between primes.
A378356 - 1 gives next prime after perfect powers, union A378365 - 1.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#+1&,Prime[n],Not@*perpowQ],{n,100}]//Differences
Previous Showing 11-17 of 17 results.