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.

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