Question: I would like to find the formula for a periodic sequence such as 4, 1, 1/4, 1/4, 1, 4... with a period of 6

Answer: 
You want, presumably, $f(x)$ such that $f(1)=4,f(2)=1...$ and so on, with a period of $6$, so that there will be lines of symmetry at $x=\frac 12,\frac 72$ and so on.

This can be modelled by a displaced cosine curve which includes a similarly periodic adjustment factor which "warps" the cosine wave to fit the point $(2,1)$.

Therefore we can try $$f(x)=\frac{\mu\cos(\frac{\pi x}{3}-\frac{\pi}{6})+\nu}{\lambda+\cos(\frac{\pi x}{3}-\frac{\pi}{6})}$$

On substituting for $x=1,2,3$ we get three equations and can identify the contants $\lambda,\mu,\nu$, and obtain

$$f(x)=\frac{5\sqrt{3}+6\cos(\frac{\pi x}{3}-\frac{\pi}{6})}{5\sqrt{3}-6\cos(\frac{\pi x}{3}-\frac{\pi}{6})}$$
> 
> *Hint:* The $r$-th roots of unity $\omega\_j=\exp\left(\frac{2\pi ij}{r}\right), 0\leq j<r$ have the nice property to *filter* elements. For $r>0$ we obtain
>  \begin{align\*}
> \frac{1}{r}\sum\_{j=0}^{r-1}\exp\left(\frac{2\pi ij n}{r}\right)=
> \begin{cases}
> 1&\qquad r\mid n\\
> 0& \qquad otherwise
> \end{cases}
> \end{align\*}
>  Therefore the sequence
>  \begin{align\*}
> \left(\frac{1}{6}\sum\_{j=0}^5\exp\left(\frac{2\pi ijn}{6}\right)\right)\_{n=0}^{\infty}
> =(1,0,0,0,0,0,1,0,0,0,0,0,1,\ldots)\tag{1}
> \end{align\*}
>  generates a $1$ at each $6$-th position and $0$ otherwise and multiplication with $4$ gives a sequence with $4$ at each $6$-th position and $0$ otherwise.
> 
> 
> Appropriately shifting of (1) can be used to generate a $1$ on each $6$-th position shifted by $k$ positions with $0\leq k < 6$. Multiplication with $4,1$ and $\frac{1}{4}$ and adding all these terms provides the wanted sequence.
> 
> 
> 

*Hint:* Some instructive examples can be found in H.S. Wilf's book *[generatingfunctionology](https://www.math.upenn.edu/~wilf/gfology2.pdf)*, (2.4.5) to (2.4.9).