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.

A377468 Least perfect-power >= n.

This page as a plain text file.
%I A377468 #18 Nov 06 2024 04:12:03
%S A377468 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,
%T A377468 27,32,32,32,32,32,36,36,36,36,49,49,49,49,49,49,49,49,49,49,49,49,49,
%U A377468 64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,81,81,81
%N A377468 Least perfect-power >= n.
%C A377468 Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.
%F A377468 Positions of first appearances for n > 2 are A216765(n-2) = A001597(n-1) + 1.
%t A377468 perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
%t A377468 Table[NestWhile[#+1&,n,#>1&&!perpowQ[#]&],{n,100}]
%o A377468 (Python)
%o A377468 from sympy import mobius, integer_nthroot
%o A377468 def A377468(n):
%o A377468     if n == 1: return 1
%o A377468     def bisection(f,kmin=0,kmax=1):
%o A377468         while f(kmax) > kmax: kmax <<= 1
%o A377468         while kmax-kmin > 1:
%o A377468             kmid = kmax+kmin>>1
%o A377468             if f(kmid) <= kmid:
%o A377468                 kmax = kmid
%o A377468             else:
%o A377468                 kmin = kmid
%o A377468         return kmax
%o A377468     def f(x): return int(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
%o A377468     m = n-f(n-1)
%o A377468     return bisection(lambda x:f(x)+m,n-1,n) # _Chai Wah Wu_, Nov 05 2024
%Y A377468 The version for prime-powers is A000015.
%Y A377468 The union is A001597 (perfect-powers), without powers of two A377702.
%Y A377468 Positions of last appearances are also A001597.
%Y A377468 The version for primes is A007918 or A151800.
%Y A377468 The version for squarefree numbers is A067535.
%Y A377468 Run-lengths are A076412.
%Y A377468 The opposite version (greatest perfect-power <= n) is A081676.
%Y A377468 A000040 lists the primes, differences A001223.
%Y A377468 A000961 lists the powers of primes, differences A057820.
%Y A377468 A001597 lists the perfect-powers, differences A053289, seconds A376559.
%Y A377468 A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
%Y A377468 A069623 counts perfect-powers <= n.
%Y A377468 A076411 counts perfect-powers < n.
%Y A377468 A131605 lists perfect-powers that are not prime-powers.
%Y A377468 A377432 counts perfect-powers between primes, zeros A377436.
%Y A377468 Cf. A014210, A014234, A023055, A031218, A045542, A052410, A065514, A188951, A216765, A336416, A345531.
%K A377468 nonn
%O A377468 1,2
%A A377468 _Gus Wiseman_, Nov 05 2024