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 A258567 #22 Sep 11 2024 00:32:40 %S A258567 1,2,2,3,2,5,3,2,2,7,2,2,3,2,2,11,5,2,2,13,2,2,2,3,3,2,2,17,2,7,19,2, %T A258567 2,2,3,2,2,2,23,2,5,2,3,2,3,2,2,29,2,2,31,2,2,2,2,3,3,2,2,5,2,3,11,2, %U A258567 37,2,2,3,2,2,41,2,2,2,43,2,2,2,3,2,2,3 %N A258567 a(1) = 1; thereafter a(n) = smallest prime factor of the powerful number A001694(n). %H A258567 Reinhard Zumkeller, <a href="/A258567/b258567.txt">Table of n, a(n) for n = 1..10000</a> %F A258567 a(n) = A020639(A001694(n)). %F A258567 a(A258599(n)) = A000040(n) and a(m) != A000040(n) for m < A258599(n). %t A258567 Table[If[Min[(f = FactorInteger[n])[[;; , 2]]] > 1 || n == 1, f[[1, 1]], Nothing], {n, 1, 3000}] (* _Amiram Eldar_, Jan 30 2023 *) %o A258567 (Haskell) %o A258567 a258567 = a020639 . a001694 %o A258567 (Python) %o A258567 from math import isqrt %o A258567 from sympy import mobius, integer_nthroot, primefactors %o A258567 def A258567(n): %o A258567 def squarefreepi(n): %o A258567 return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1))) %o A258567 def bisection(f, kmin=0, kmax=1): %o A258567 while f(kmax) > kmax: kmax <<= 1 %o A258567 while kmax-kmin > 1: %o A258567 kmid = kmax+kmin>>1 %o A258567 if f(kmid) <= kmid: %o A258567 kmax = kmid %o A258567 else: %o A258567 kmin = kmid %o A258567 return kmax %o A258567 def f(x): %o A258567 c, l = n+x, 0 %o A258567 j = isqrt(x) %o A258567 while j>1: %o A258567 k2 = integer_nthroot(x//j**2, 3)[0]+1 %o A258567 w = squarefreepi(k2-1) %o A258567 c -= j*(w-l) %o A258567 l, j = w, isqrt(x//k2**3) %o A258567 c -= squarefreepi(integer_nthroot(x, 3)[0])-l %o A258567 return c %o A258567 return min(primefactors(bisection(f,n,n)),default=1) # _Chai Wah Wu_, Sep 10 2024 %Y A258567 Cf. A001694, A020639, A258599, A258568, A258569, A258570, A258571. %K A258567 nonn %O A258567 1,2 %A A258567 _Reinhard Zumkeller_, Jun 06 2015 %E A258567 Definition made more precise by _N. J. A. Sloane_, Apr 29 2024