# Help me find equation of this graph

I need to find equations of this list: $[1,1,1,0,0,0,1,1,1,0,0,0, ...]$ (it's periodic)

The closest equation I've got is $\left\lceil \sin (\frac{\pi}{3}x)\right\rceil$, which looks like this:

  _   _   _
_| |_| |_| |_


But I need it to look like this:

  _   _   _
_/ \_/ \_/ \_


Can you help me?

-

You may try the simple function $$f(x)=|(x-s) \bmod 6 -3|-1$$ (the 'shift' $s$ is $0$ for the first list , $1$ for the second and so on...)
by replacing values over $1$ by $1$ and under $0$ by $0$

Or don't you allow tests?

-
Your solution is almost right. The correct function would be $max(0,min(your function,1))$. I like your solution better because it's simpler. –  Cobold Aug 8 '12 at 9:25
@Cobold: yes it is nicer combined with J.M.'s max(min()) classical trick (note my (misplaced) "by replacing values over 1 by..."). Glad you liked it anyway, –  Raymond Manzoni Aug 8 '12 at 9:34

I'd use

$$\max\left(0,\min\left(\frac12-\frac3{\pi}\arcsin\left(\cos\left(\frac{\pi}{3}(x+1)\right)\right),1\right)\right)$$

-

It seems you are looking for the left shift operator $S_l$: $$S_l: (x_j)_{j=1}^{\infty}\mapsto (x_j)_{j=2}^{\infty}$$ It simply crosses out the first component of the sequence. You can write your whole sequence $(x^{(n)})_{n=1}^{\infty}$of "lists" as powers of this operator $S_l$: $x^{(n)} = S^{n-1}_lx^{(1)}$

I hope this helps.

-

See http://oeis.org/A088911 ... The $n$th term ($n = 0, 1, 2, ...)$ of the sequence $1^k 0^k 1^k 0^k ...$ is

$$a(n,k) = \left\lfloor \frac{(n+k)\mod 2k}{k}\right\rfloor$$

so your function can be written

$$f(n) = a(n,3) = \left\lfloor \frac{(n+3)\mod 6}{3}\right\rfloor.$$

The linked article also shows other ways to write it.

-