# Describe the sequence $2,2,1,0,0,1,2,2,…$ using the floor function

Is there a way to describe the sequence $$2,2,1,0,0,1,2,2,1,0,0,1,2,2...$$ by using the floor function?

I can describe the series using a sinusoidal function but wanted to get it in terms of a floor function for a tricky proof. The sinusoidal function is:

$$u(n)=-\frac{2\sqrt{3}}{3}sin(\frac{\pi}{3}n-\pi)+1$$

• Any thoughts about the answer I posted yesterday, Joseph? – Gerry Myerson Oct 12 '18 at 1:09
• Earth to Joseph, come in, please. – Gerry Myerson Oct 13 '18 at 11:49
• @GerryMyerson thanks so much for the response and creative solution! Originally, I needed this series in an induction proof, but I could get around it by doing the proof by induction for every n=k+6 member and testing n=1,2,3,4,5,6. Either function would work but I stuck with the cosine because it ended up working out nicely with the math. Thank you a bunch though! – Joseph Schmidt Oct 31 '18 at 14:38
• What cosine? I don't see any. – Gerry Myerson Nov 1 '18 at 8:47
• sorry I meant the sin function – Joseph Schmidt Nov 7 '18 at 4:23

$$\lfloor(n+5)/6\rfloor-\lfloor(n+4)/6\rfloor$$ gives the sequence $$1,0,0,0,0,0$$ repeating. So what you want is $$2\lfloor{n+5\over6}\rfloor-2\lfloor{n+4\over6}\rfloor+2\lfloor{n+4\over6}\rfloor-2\lfloor{n+3\over6}\rfloor+\lfloor{n+3\over6}\rfloor-\lfloor{n+2\over6}\rfloor+\lfloor{n\over6}\rfloor-\lfloor{n-1\over6}\rfloor$$ which simplifies a little to $$2\lfloor{n+5\over6}\rfloor-\lfloor{n+3\over6}\rfloor-\lfloor{n+2\over6}\rfloor+\lfloor{n\over6}\rfloor-\lfloor{n-1\over6}\rfloor$$