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 A100112 #27 Feb 16 2025 08:32:55 %S A100112 1,2,3,0,4,5,6,0,0,7,8,0,9,10,11,0,12,0,13,0,14,15,16,0,0,17,0,0,18, %T A100112 19,20,0,21,22,23,0,24,25,26,0,27,28,29,0,0,30,31,0,0,0,32,0,33,0,34, %U A100112 0,35,36,37,0,38,39,0,0,40,41,42,0,43,44,45,0,46,47,0,0,48,49,50,0,0,51,52,0 %N A100112 If n is the k-th squarefree number then a(n) = k, otherwise a(n) = 0. %H A100112 Charles R Greathouse IV, <a href="/A100112/b100112.txt">Table of n, a(n) for n = 1..10000</a> %H A100112 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Squarefree.html">Squarefree</a> %F A100112 a(A005117(n)) = n; %F A100112 a(n) = (A013928(n) + 1)*A008966(n). %F A100112 a(n) = Sum_{k=1..n} mu(lcm(n,k))^2. - _Benoit Cloitre_, Jun 14 2007 %t A100112 a[n_] := Sum[MoebiusMu[LCM[n, k]]^2, {k, 1, n}]; %t A100112 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Nov 18 2021, after _Benoit Cloitre_ *) %o A100112 (PARI) a(n)=sum(k=1,n,moebius(lcm(n,k))^2) \\ _Benoit Cloitre_, Jun 14 2007 %o A100112 (PARI) first(n)=my(v=vector(n),k); forsquarefree(m=1,n, v[m[1]]=k++); v \\ _Charles R Greathouse IV_, Jan 08 2018 %o A100112 (Python) %o A100112 from sympy import integer_nthroot, mobius %o A100112 def A100112(n): %o A100112 b = 0 %o A100112 k, r = integer_nthroot(n,2) %o A100112 a, c = (mobius(k),k-1) if r else (0,k) %o A100112 for i in range(1,c+1): %o A100112 m, j = mobius(i), i**2 %o A100112 a += m*(n//j) %o A100112 b += m*((n-1)//j) %o A100112 return a if a>b else 0 # _Chai Wah Wu_, May 11 2024 %Y A100112 Cf. A005117, A008966, A013928. %K A100112 nonn,easy %O A100112 1,2 %A A100112 _Reinhard Zumkeller_, Nov 07 2004