What is the closed form for the sequence $1,0,1,1,0,0,1,1,1,0,0,0...$?

286 Views Asked by At

I thought about $$\frac{1+(-1)^k}{2}$$ but it didn't work ! Is there any closed form for it ?

3

There are 3 best solutions below

0
On BEST ANSWER

The sequence can be broken to chucks with even lengths, i.e. $$ { 0<k\le2\implies f(k)=1-\lfloor\frac{k}{2}\rfloor \\ 2<k\le6\implies f(k)=1-\lfloor\frac{k}{5}\rfloor \\ \vdots \\ u(u+1)<k\le(u+1)(u+2)\implies f(k)=1-\lfloor\frac{k}{(u+1)^2+1}\rfloor } $$ From the other side , $$ { u(u+1)<k\le(u+1)(u+2) \\\iff u^2+u<k\le u^2+3u+2 \\\iff 4u^2+4u<4k\le 4u^2+12u+8 \\\iff 4u^2+4u+1<4k+1\le 4u^2+12u+9 \\\iff (2u+1)^2<4k+1\le (2u+3)^2 \\\iff 2u+1<\sqrt{4k+1}\le 2u+3 \\\iff 2u+2\le \sqrt{4k+1}< 2u+4 \\\iff u+1\le \sqrt{k+0.25}< u+2 \\\iff u+1=\lfloor \sqrt{k+0.25}\rfloor \\\iff u=\lfloor \sqrt{k+0.25}\rfloor-1 }. $$ Finally, the general term becomes

$$f(k)=1-\left\lfloor\frac{k}{1+\left\lfloor\sqrt{k+0.25}\right\rfloor^2}\right\rfloor$$

It can also be expressed as $$ f(k)=\frac{1+(-1)^{g(k)}}{2}, $$ where $$ g(k)=\left\lfloor\frac{k}{1+\left\lfloor\sqrt{k+0.25}\right\rfloor^2}\right\rfloor . $$

0
On

There are several possibilities. One is the sequence which is $1$ if $n$ product of odd number of primes and $0$ if $n$ is the product of even number of primes. This sequence starting from $n\ge 5$ is given by $$ 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, $$ A second possibility is the common residue of $\binom{3n}{n}/(2n+1)$ modulo 2. A third one, the number of times the digit $2$ appears in the decimal expansion of $n^3$.

0
On

According to OEIS, this formula works: $$ \left \lfloor \sqrt{k+1} + \frac1{2} \right \rfloor - \left \lfloor \sqrt{k} \right \rfloor $$