Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #30 Aug 29 2024 01:37:40
%S 1,2,3,5,2,7,2,11,13,2,3,17,19,3,2,23,2,29,2,31,3,2,5,37,2,3,41,2,43,
%T 2,47,3,53,5,3,2,59,61,2,5,2,67,3,2,71,73,2,7,2,79,2,83,5,2,3,89,7,3,
%U 2,5,97,101,2,103,3,2,107,109,2,3,113,2,5,2,7,2,3,127,3,2,131,7,2,137,2,139,3,2,11,5
%N Least prime factor of the n-th squarefree number.
%H Reinhard Zumkeller, <a href="/A073481/b073481.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A020639(A005117(n)).
%F a(n) = A265668(n,1). - _Reinhard Zumkeller_, Dec 13 2015
%t a = Select[Range[300], SquareFreeQ[#]&]; Table[FactorInteger[a[[n]]][[1,1]], {n, Length[a]}] (* _Vladimir Joseph Stephan Orlovsky_, Jan 30 2012 *)
%o (Haskell)
%o a073482 = a020639 . a005117 -- _Reinhard Zumkeller_, Feb 04 2012
%o (PARI) apply(x->(if (x==1,1, vecmin(factor(x)[,1]))), select(issquarefree, [1..150])) \\ _Michel Marcus_, Dec 17 2023
%o (Python)
%o from math import isqrt
%o from sympy import mobius, primefactors
%o def A073481(n):
%o def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
%o kmin, kmax = 0,1
%o while f(kmax) > kmax:
%o kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return min(primefactors(kmax),default=1) # _Chai Wah Wu_, Aug 28 2024
%Y Cf. A073482.
%Y Cf. A005117, A020639, A265668.
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, Aug 03 2002
%E More terms from _Jason Earls_, Aug 06 2002