login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A081221
Number of consecutive numbers >= n having at least one square divisor > 1.
14
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,8
COMMENTS
The first time terms 0..7 occur is at n = 1, 4, 8, 48, 242, 844, 22020, 217070. - Antti Karttunen, Sep 22 2017
LINKS
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
EXAMPLE
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
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 *)
PROG
(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
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Mar 10 2003
STATUS
approved