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 A080733 #14 Sep 23 2017 19:11:51 %S A080733 0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,1,0,1,1,0,0,0,1,0,0, %T A080733 0,1,0,0,0,1,0,0,0,1,1,0,0,1,2,1,0,1,0,1,0,1,0,0,0,1,0,0,1,1,0,0,0,1, %U A080733 0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,1,2,1,0,0,0,1,0 %N A080733 Smallest distance from n to a squarefree number. %C A080733 a(n) = min (abs(n-k) : where k runs through the squarefree numbers ). %C A080733 The sequence is unbounded. %C A080733 The first 0 occurs at 1, the first 1 at 4, the first 2 at 49, the first 3 at 846. - _Antti Karttunen_, Sep 22 2017 %H A080733 Antti Karttunen, <a href="/A080733/b080733.txt">Table of n, a(n) for n = 1..65537</a> %F A080733 a(A005117(n)) = 0. %e A080733 For n = 3, 3 itself is a squarefree number, thus a(3) = 0. %e A080733 For n = 48, 48 = 2^4 * 3 is not squarefree, 49 = 7^2 is not squarefree, but 47 is, thus a(48) = abs(48-47) = 1. %e A080733 For n = 49, neither 49 = 7^2, nor 48 = 2^4 * 3 nor 50 = 2^2 * 5 is squarefree, while both 47 and 51 are, thus a(49) = abs(49-47) = abs(49-51) = 2. %t A080733 nn=110;With[{sqfr=Select[Range[nn+10],SquareFreeQ]},Flatten[Table[ Union[ Abs[ Nearest[ sqfr,n]-n]],{n,nn}]]] (* _Harvey P. Dale_, Jun 01 2012 *) %o A080733 (PARI) A080733(n) = { my(k=0); while((!issquarefree(n+k))&&(!issquarefree(n-k)),k++); k; }; \\ _Antti Karttunen_, Sep 22 2017 %Y A080733 Cf. A051699. %Y A080733 Cf. A005117, A081221. %K A080733 nonn %O A080733 1,49 %A A080733 _Benoit Cloitre_, Mar 08 2003 %E A080733 Examples added by _Antti Karttunen_, Sep 22 2017