I should probably have figured this out by now, but I'm exhausted and I've spent way too long on such a small part of a larger problem.
I'm trying to find a function that alternates between two numbers (for simplicity I've chosen $0$ and $1$) repeating each number $\frac{n}{2}$ times. With it's "cycle length" being $c$. So, it repeats every $n$th number. For example, a function with a cycle length of $10$ would go: $\left\{0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1...\right\}$
How would one go about constructing a function for a cycle of length $n$?
$$\left\lfloor \frac{2k}{n} \right\rfloor \bmod 2, \quad k=0, 1, 2, 3,\ldots$$ where $n$ is your (even) cycle length. The quotient is simplier when using the cycle half-length $c=\frac{n}{2}$: $$\left\lfloor \frac{k}{c} \right\rfloor \bmod 2, \quad k=0, 1, 2, 3,\ldots$$