OFFSET
0,2
COMMENTS
The maximum run of squarefree numbers is 3, since 4*n is nonsquarefree. Because of this, we may classify the n-th interval according to which numbers, 4*n+1, 4*n+2, or 4*n+3, are squarefree. Since a number is either squarefree (in A005117) or not (in A013929), there 2^3 possibilities, hence 8 classes.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..14641
Michael De Vlieger, Plot a(n) at (x,y) = (n mod p^2, -floor(n/p^2)) for prime p = {3, 5, 7, 11, 13} and y <= 120 using color function described in the example.
FORMULA
EXAMPLE
Table of possible configurations of squarefree numbers that come between multiples of 4, along with a simple algorithm of representing same with RGB color:
R G B
f(4*n+1) f(4*n+2) f(4*n+3) -> binary -> a(n) RGB color
------------------------------------------------------------
0 0 0 000 0 black
0 0 1 001 1 blue
0 1 0 010 2 green
0 1 1 011 3 cyan
1 0 0 100 4 red
1 0 1 101 5 magenta
1 1 0 110 6 yellow
1 1 1 111 7 white
a(0) = 0 since, for n = 0, 4*n+1 = 1, 4*n+2 = 2, and 4*n+3 = 3, none are both squarefree and composite, therefore we have the binary number 000_2 = 0.
a(1) = 2 since, for n = 1, 4*n+1 = 5, 4*n+2 = 6, and 4*n+3 = 7, only 6 is squarefree and composite, thus we have the binary number 010_2 = 2.
a(2) = 2 since, for n = 2, 4*n+1 = 9, 4*n+2 = 10, and 4*n+3 = 11, only 10 is squarefree and composite, thus we have the binary number 010_2 = 2.
a(5) = 6 since, for n = 5, 4*n+1 = 21, 4*n+2 = 22, and 4*n+3 = 23, only the first 2 are both squarefree and composite, thus we have the binary number 110_2 = 6.
a(8) = 7 since, for n = 8, 4*n+1 = 33, 4*n+2 = 34, and 4*n+3 = 35, all are both squarefree and composite, thus we have the binary number 111_2 = 7, etc.
MATHEMATICA
Table[FromDigits[#, 2] &@ Map[Boole[And[CompositeQ[#], SquareFreeQ[#] ] ] &, 4*n + Range[3] ], {n, 0, 120}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Michael De Vlieger, Oct 25 2025
STATUS
approved
