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.

A073481 Least prime factor of the n-th squarefree number.

This page as a plain text file.
%I A073481 #30 Aug 29 2024 01:37:40
%S A073481 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 A073481 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 A073481 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 A073481 Least prime factor of the n-th squarefree number.
%H A073481 Reinhard Zumkeller, <a href="/A073481/b073481.txt">Table of n, a(n) for n = 1..10000</a>
%F A073481 a(n) = A020639(A005117(n)).
%F A073481 a(n) = A265668(n,1). - _Reinhard Zumkeller_, Dec 13 2015
%t A073481 a = Select[Range[300], SquareFreeQ[#]&]; Table[FactorInteger[a[[n]]][[1,1]], {n, Length[a]}] (* _Vladimir Joseph Stephan Orlovsky_, Jan 30 2012 *)
%o A073481 (Haskell)
%o A073481 a073482 = a020639 . a005117  -- _Reinhard Zumkeller_, Feb 04 2012
%o A073481 (PARI) apply(x->(if (x==1,1, vecmin(factor(x)[,1]))), select(issquarefree, [1..150])) \\ _Michel Marcus_, Dec 17 2023
%o A073481 (Python)
%o A073481 from math import isqrt
%o A073481 from sympy import mobius, primefactors
%o A073481 def A073481(n):
%o A073481     def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
%o A073481     kmin, kmax = 0,1
%o A073481     while f(kmax) > kmax:
%o A073481         kmax <<= 1
%o A073481     while kmax-kmin > 1:
%o A073481         kmid = kmax+kmin>>1
%o A073481         if f(kmid) <= kmid:
%o A073481             kmax = kmid
%o A073481         else:
%o A073481             kmin = kmid
%o A073481     return min(primefactors(kmax),default=1) # _Chai Wah Wu_, Aug 28 2024
%Y A073481 Cf. A073482.
%Y A073481 Cf. A005117, A020639, A265668.
%K A073481 nonn
%O A073481 1,2
%A A073481 _Reinhard Zumkeller_, Aug 03 2002
%E A073481 More terms from _Jason Earls_, Aug 06 2002