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.

A076260 a(n) = 0 if n is a squarefree number, otherwise the distance between the two nearest squarefree numbers around n: A067535(n)-A070321(n).

Original entry on oeis.org

0, 0, 0, 2, 0, 0, 0, 3, 3, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 3, 3, 0, 3, 3, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 3, 3, 0, 0, 4, 4, 4, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 3, 3, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 3, 3, 0, 0, 0, 3, 3, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 4, 4, 4, 0, 0, 0, 2, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 03 2002

Keywords

Comments

a(n)=0 iff n is squarefree; otherwise a(n) > 1.

Examples

			The nearest squarefree numbers surrounding 25 = 5^2 are A070321(25) = 23 and A067535(25) = 26, therefore a(25) = 26-23 = 3. - Edited by _Antti Karttunen_, Nov 23 2017
		

Crossrefs

Programs

  • Mathematica
    Block[{nn = 105, s}, s = Select[Range[nn + 15], SquareFreeQ]; Array[If[FreeQ[s, #], First@ Differences@ s[[# - 1 ;; #]] &@ FirstPosition[Union@ Append[s, #], #][[1]], 0] &, 105]] (* Michael De Vlieger, Nov 23 2017 *)
  • PARI
    A067535(n) = { while(!issquarefree(n), n++); n; } \\ These two functions from Michel Marcus, Mar 18 2017
    A070321(n) = { while(!issquarefree(n), n--); n; }
    A076260(n) = (A067535(n)-A070321(n)); \\ Antti Karttunen, Nov 22 2017

Extensions

Definition corrected to match with the data as the old definition was that of A080733 - Antti Karttunen, Nov 23 2017