A117183 a(n) = smallest prime dividing n-th nonsquarefree positive integer.
2, 2, 3, 2, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 2, 3, 2, 7, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 11, 2, 5, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 13, 3, 2, 5, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 5, 2, 2, 2, 2, 2, 3, 2, 2, 2
Offset: 1
Keywords
Examples
12, the 4th nonsquarefree positive integer, is 2^2 * 3. 2 is the smallest prime dividing 12. So a(4) = 2.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Harvey P. Dale)
Programs
-
Maple
with(numtheory): a:=proc(n) if mobius(n)=0 then op(1,factorset(n)) fi end: seq(a(n),n=1..345); # Emeric Deutsch
-
Mathematica
FactorInteger[ # ][[1, 1]] & /@ Select[ Range@252, !SquareFreeQ@# &] (* Robert G. Wilson v, Mar 06 2006 *) FactorInteger[#][[1,1]]&/@DeleteCases[Range[300],?SquareFreeQ] (* _Harvey P. Dale, Jun 02 2017 *)
-
PARI
list(lim) = apply(x -> factor(x)[1,1], select(x -> !issquarefree(x), vector(lim, i, i))); \\ Amiram Eldar, Jun 25 2025
Extensions
More terms from Emeric Deutsch and Robert G. Wilson v, Mar 06 2006