login
A386686
Classification of the interval [4*n+1, 4*n+2, 4*n+3] according to positions of squarefree composite numbers.
2
0, 2, 2, 3, 0, 6, 2, 2, 7, 3, 2, 2, 1, 1, 6, 2, 6, 6, 2, 6, 2, 7, 1, 7, 0, 2, 6, 3, 3, 3, 3, 0, 6, 6, 2, 7, 6, 0, 3, 3, 4, 6, 2, 2, 6, 3, 7, 2, 3, 0, 7, 6, 6, 7, 7, 6, 2, 3, 1, 6, 0, 3, 4, 7, 3, 2, 7, 0, 6, 2, 2, 7, 3, 1, 3, 7, 4, 6, 2, 3, 7, 3, 6, 3, 1, 4, 6
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.
The sequence that employs this classification methodology is A063736; this sequence borrows Labos' classification in A063736 but ignores primes.
LINKS
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
Let f(x) = A008966(x) - A010051(x) = A354819(x) for x > 1, with f(1) = 0.
Thus f(k) = 1 for squarefree composite k (in A120944), else f(k) = 0 for k that are neither squarefree nor composite (in A363597).
a(n) = 4*f(4*n+1) + 2*f(4*n+2) + f(4*n+3).
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}]
KEYWORD
nonn,base,easy
AUTHOR
Michael De Vlieger, Oct 25 2025
STATUS
approved