login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080733 Smallest distance from n to a squarefree number. 5
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

Antti Karttunen, Table of n, a(n) for n = 1..65537

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.

Cf. A005117, A081221.

Sequence in context: A144961 A144627 A135929 * A080732 A301295 A215036

Adjacent sequences:  A080730 A080731 A080732 * A080734 A080735 A080736

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 25 19:38 EST 2020. Contains 332257 sequences. (Running on oeis4.)