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.

A309913 Distance from n to closest squarefree number that is different from n.

This page as a plain text file.
%I A309913 #5 Aug 23 2019 14:10:18
%S A309913 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,1,3,1,1,1,1,1,1,1,
%T A309913 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,
%U A309913 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1
%N A309913 Distance from n to closest squarefree number that is different from n.
%H A309913 <a href="/index/Di#distance_to_the_nearest">Index entries for sequences related to distance to nearest element of some set</a>
%t A309913 a[n_] := Module[{k = 1}, While[! SquareFreeQ[n + k] && ! SquareFreeQ[n - k], k++]; k]; Table[a[n], {n, 0, 100}]
%Y A309913 Cf. A005117, A051700, A080733, A316190.
%K A309913 nonn
%O A309913 0,18
%A A309913 _Ilya Gutkovskiy_, Aug 22 2019