login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080733 Smallest distance from n to a squarefree number. 6
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,49
COMMENTS
a(n) = min (abs(n-k) : where k runs through the squarefree numbers ).
The sequence is unbounded.
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
LINKS
FORMULA
a(A005117(n)) = 0.
EXAMPLE
For n = 3, 3 itself is a squarefree number, thus a(3) = 0.
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.
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.
MATHEMATICA
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 *)
PROG
(PARI) A080733(n) = { my(k=0); while((!issquarefree(n+k))&&(!issquarefree(n-k)), k++); k; }; \\ Antti Karttunen, Sep 22 2017
CROSSREFS
Cf. A051699.
Sequence in context: A135929 A346377 A338757 * A080732 A301295 A215036
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 08 2003
EXTENSIONS
Examples added by Antti Karttunen, Sep 22 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:07 EDT 2024. Contains 371964 sequences. (Running on oeis4.)