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.
%I A378035 #22 Nov 26 2024 02:18:37 %S A378035 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, %T A378035 100,100,100,100,100,125,128,128,128,144,144,144,144,144,169,169,169, %U A378035 169,169,196,196,196,216,225,225,225,225,225,243,256,256,256,256 %N A378035 Greatest perfect power < prime(n). %C A378035 Perfect powers (A001597) are 1 and numbers with a proper integer root, complement A007916. %e A378035 The first number line below shows the perfect powers. %e A378035 The second shows each positive integer k at position prime(k). %e A378035 -1-----4-------8-9------------16----------------25--27--------32------36---- %e A378035 ===1=2===3===4=======5===6=======7===8=======9==========10==11==========12== %t A378035 radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1; %t A378035 Table[NestWhile[#-1&,Prime[n],radQ[#]&],{n,100}] %o A378035 (PARI) a(n) = my(k=prime(n)-1); while (!(ispower(k) || (k==1)), k--); k; \\ _Michel Marcus_, Nov 25 2024 %o A378035 (Python) %o A378035 from sympy import mobius, integer_nthroot, prime %o A378035 def A378035(n): %o A378035 def bisection(f,kmin=0,kmax=1): %o A378035 while f(kmax) > kmax: kmax <<= 1 %o A378035 while kmax-kmin > 1: %o A378035 kmid = kmax+kmin>>1 %o A378035 if f(kmid) <= kmid: %o A378035 kmax = kmid %o A378035 else: %o A378035 kmin = kmid %o A378035 return kmax %o A378035 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 A378035 m = (p:=prime(n)-1)-f(p) %o A378035 return bisection(lambda x:f(x)+m,m,m) # _Chai Wah Wu_, Nov 25 2024 %Y A378035 Restriction of A081676 to the primes. %Y A378035 Positions of last appearances are also A377283. %Y A378035 A version for squarefree numbers is A378032. %Y A378035 The opposite is A378249 (run lengths A378251), restriction of A377468 to the primes. %Y A378035 The union is A378253. %Y A378035 Terms appearing exactly once are A378355. %Y A378035 Run lengths are A378356, first differences of A377283, complement A377436. %Y A378035 A000040 lists the primes, differences A001223. %Y A378035 A000961 lists the powers of primes, differences A057820. %Y A378035 A001597 lists the perfect powers, differences A053289. %Y A378035 A007916 lists the nonperfect powers, differences A375706. %Y A378035 A069623 counts perfect powers <= n. %Y A378035 A076411 counts perfect powers < n. %Y A378035 A080769 counts primes between perfect powers, prime powers A067871. %Y A378035 A131605 lists perfect powers that are not prime powers. %Y A378035 A377432 counts perfect powers between primes, zeros A377436, postpositives A377466. %Y A378035 Cf. A000015, A007918, A031218, A045542, A052410, A065514, A076412, A188951, A216765, A345531, A377434, A378250. %K A378035 nonn %O A378035 1,3 %A A378035 _Gus Wiseman_, Nov 23 2024