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.

Showing 1-5 of 5 results.

A081221 Number of consecutive numbers >= n having at least one square divisor > 1.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 10 2003

Keywords

Comments

The first time terms 0..7 occur is at n = 1, 4, 8, 48, 242, 844, 22020, 217070. - Antti Karttunen, Sep 22 2017

Examples

			For n = 3, 3 is a squarefree number, thus a(3) = 0.
For n = 48, neither 48 = 2^4 * 3 nor 49 = 7^2, nor 50 = 2^2 * 5 are squarefree, but 51 = 3*17 is, thus a(48) = 3. - _Antti Karttunen_, Sep 22 2017
		

Crossrefs

Programs

  • Mathematica
    Flatten@ Map[If[First@ # == 0, #, Reverse@ Range@ Length@ #] &, SplitBy[Table[DivisorSum[n, 1 &, And[# > 1, IntegerQ@ Sqrt@ #] &], {n, 120}], # > 0 &]] (* Michael De Vlieger, Sep 22 2017 *)
  • PARI
    A081221(n) = { my(k=0); while(!issquarefree(n+k),k++); k; }; \\ Antti Karttunen, Sep 22 2017
    
  • Python
    from itertools import count
    from sympy import factorint
    def A081221(n): return next(m for m in count(0) if max(factorint(n+m).values(),default=0)<=1) # Chai Wah Wu, Dec 04 2024

Formula

mu(k) = 0 for n <= k < n+a(n) and mu(n+a(n)) <> 0, where mu = A008683 (Moebius function).
a(n)*mu(n) = 0.
a(A068781(n)) > 0.
a(n) = A067535(n) - n. - Amiram Eldar, Oct 10 2023

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

A087049 Characteristic sequence for numbers n>=0 that are either squares or have a square > 1 as factor.

Original entry on oeis.org

1, 1, 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, 1, 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, 1, 1, 0, 0, 0, 1
Offset: 0

Views

Author

Wolfdieter Lang, Sep 08 2003

Keywords

Comments

a(0)=1, a(1)=1, n>=2: a(n)=1 if isquarefree(n)=false else 0.
Except for a(0)=1 and a(1)=1 this is the bit-flipped unsigned Moebius sequence abs(A008683(n)), n>=2.
For n>=2: a(n)=1 iff n is from A013929 (not squarefree).

Examples

			a(4) = 1 because 4 is a square; a(8) = 1 because 8 = 2^2 * 2.
		

Crossrefs

Cf. A008683, A008966, A080733, A000290 (squares), A013929 (not squarefree), A229099.

Programs

  • Maple
    1,1,seq(`if`(numtheory:-issqrfree(n),0,1),n=2..100); # Robert Israel, Nov 17 2017
  • Mathematica
    Array[If[# <= 1, 1, 1 - Abs@ MoebiusMu@ #] &, 105, 0] (* Michael De Vlieger, Nov 17 2017 *)
  • PARI
    A087049(n) = if(n<=1,1,1-abs(moebius(n))); \\ Antti Karttunen, Nov 17 2017

Formula

a(n) = 1 if n is a perfect square (A000290) or has some square > 1 as a factor, else 0.
a(0) = a(1) = 1; for n > 1, a(n) = 1 - A008966(n). - Antti Karttunen, Nov 17 2017
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 1 - 6/Pi^2 (A229099). - Amiram Eldar, Jan 19 2024

A369164 a(n) = A001221(A000688(n)).

Original entry on oeis.org

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, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Amiram Eldar, Jan 15 2024

Keywords

Comments

First differs from A369165 at n = 36, from A080733 at n = 49, and from A107078 at n = 72.
The sums of the first 10^k terms, for k = 1, 2, ..., are 3, 40, 426, 4307, 43203, 432211, 4322486, 43226028, 432261887, 4322622387, ... . From these values the asymptotic mean of this sequence, whose existence was proven by Ivić (1983) (see the Formula section), can be empirically evaluated by 0.43226... .

References

  • József Sándor, Dragoslav S. Mitrinovic, Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Chapter V, page 164.

Crossrefs

Programs

  • Mathematica
    Table[PrimeNu[FiniteAbelianGroupCount[n]], {n, 1, 100}]
  • PARI
    a(n) = omega(vecprod(apply(numbpart, factor(n)[, 2])));

Formula

Sum_{k=1..n} a(k) = c * n + O(sqrt(n) * log(n)^3/log(log(n))^2), where c = Sum_{k>=1} d(k) * A001221(k) is a constant, d(k) is the asymptotic density of the set {m | A000688(m) = k} (e.g., d(1) = A059956, d(2) = A271971, d(3) appears in A048109) (Ivić, 1983).

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 22 2019

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[! SquareFreeQ[n + k] && ! SquareFreeQ[n - k], k++]; k]; Table[a[n], {n, 0, 100}]
Showing 1-5 of 5 results.