# Arithmetically repeating digit $1$ with interval of $n$ keeping rest of the digits $0$

I'm struggling to get a sequence of numbers $0$ and $1$ so that $1$ is repeating after a stable interval. For example:

$$\frac{(1-((-1)^{\lfloor\frac{n}{12}\rfloor} ((-1)^{\lfloor\frac{n}{11}\rfloor}))}{2}$$

will give:

0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,...


But what I really need is to repeat digit $1$ after every $12$ steps and keep rest of the digits $0$:

0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,


0,0,0,0,0,0,0,0,1,

I have tried with $mod$, $floor$, $ceiling$, $(-1)^n$ combinations, which I rather use instead of trigonometric functions or logical blocks, but haven't really made it.

• See here. – QC_QAOA Sep 10 '18 at 4:51
• @MarkokraM Just use a piecewise function... For example $\begin{cases}1&\text{if }12\mid n\\0&\text{otherwise}\end{cases}$ – user202729 Sep 10 '18 at 4:54
• Is there any other way than using summation and trigonometry to do it? – MarkokraM Sep 10 '18 at 4:55
• @user202729 I rather use plain arithmetics if possible. I added this restriction to my question. – MarkokraM Sep 10 '18 at 4:58
• Although it's possible to do it, I don't understand why. This is not code-golf, and you probably want your formula to be clear rather than short. – user202729 Sep 10 '18 at 5:00

$$1-\left\lceil\frac{n-12\left\lfloor\frac{n}{12}\right\rfloor}{12}\right\rceil=\begin{cases}1&\text{if n\equiv 0\pmod{12}}\\0&\text{if n\not\equiv 0\pmod{12}}\end{cases}$$