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})}$$
> 
> Here is a variation which utilizes the special structure of the sequence.
> 
> 
> The sequence can be written as
>  \begin{align\*}
> (a\_n)\_{n\geq 0}&=\left(4,1,\frac{1}{4},\frac{1}{4},1,4,4,1,\frac{1}{4},\ldots\right)\\
> &=\left(4^1,4^0,4^{-1},4^{-1},4^0,4^1,4^1,4^0,4^{-1},\ldots\right)
> \end{align\*}
> 
> 
> 

Since 
\begin{align\*}
\left(1-\left(n \text{ mod} (3)\right)\right)\_{n\geq 0}=(1,0,-1,1,0,-1,1,0,-1,\ldots)
\end{align\*}
and
\begin{align\*}
\left((-1)^{\left\lfloor\frac{n}{3}\right\rfloor}\right)\_{n\geq 0}=(1,1,1,-1,-1,-1,1,1,1,\ldots)
\end{align\*}
we obtain
\begin{align\*}
\left((-1)^{\left\lfloor\frac{n}{3}\right\rfloor}\left(1-\left(n \text{ mod} (3)\right)\right)\right)\_{n\geq 0}
=(1,0,-1,-1,0,1,1,0,-1,\ldots)
\end{align\*}

> 
> We conclude the sequence $(a\_n)\_{n\geq 0}$ can be written as
>  \begin{align\*}
> (a\_n)\_{n\geq 0}=\left(4^{(-1)^{\left\lfloor\frac{n}{3}\right\rfloor}\left(1-\left(n \text{ mod} (3)\right)\right)}\right)\_{n\geq 0}
> \end{align\*}
> 
> 
>