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.

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).