3

Please help me to find general 'analytical' formula fot these two sequences $\{x_n\}$, $n=1,2,3,\ldots$.

I. $0, 1, 2, 2, 3, 6, 6, 7, 14, 14, \ldots$

This meens the following.

$x_{1}=0$, $x_{2}=x_{1}+1$, $x_{3}=2x_{2}$, $x_{4}=x_{3}$, $\ldots$, $x_{3k-1}=x_{3k-2}+1$, $x_{3k}=2x_{3k-1}$, $x_{3k+1}=x_{3k}$.

II. $1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, \ldots$

That is, $x_{n}=1$ if $n=6k-5$, $k=1,2,3,\ldots$; $x_{n}=0$ otherwise.

I tried to use something like $$ x_{n}=\frac{(-1)^{n-1}+1}{2}, $$ so, we get $1, 0, 1, 0, 1, 0, \ldots$ but I need 5 zeroes after 1.

ann810
  • 31
  • For II, I would also look for a solution like that. Only, the exponent $n-1$ is even and odd alternating. Try to find a sequence that goes "odd, even, even, even, even, even, odd, even" etc, and use that as exponent instead. – Arthur Aug 06 '16 at 11:07
  • Do you think this could be solved by using a modular function embedded in your formula? Are you allowed to use something of that manner? Maybe ceiling/floor? – Joshua Lochner Aug 06 '16 at 11:09
  • Yes, ceiling/floor may be good functions. – ann810 Aug 06 '16 at 11:21

3 Answers3

1

The second one can be written as:

$$x_n=1-{\big\lceil\dfrac{n \mod 6 -1}{6}\big\rceil}$$

where we can write $n\mod 6$ as:

$$n \mod 6=n-6\big\lfloor\dfrac{n}{6}\big\rfloor$$

This definition of mod returns $0\dots5$ however, and so subtracting $1$ yields a return value in $-1\dots4$. We want to differentiate between $0$ and the other values, and so we can use the abs function ($||$)to take the absolute value of the return value:

$$x_n=1-{\big\lceil\dfrac{|n-6\big\lfloor\dfrac{n}{6}\big\rfloor-1|}{6}\big\rceil}$$

The abs function is defined as:

$$\operatorname{abs}(x)=\sqrt{x^2}$$

and so a full analytic definition of $x_n$ is:

$$x_n=1-{\big\lceil\dfrac{\sqrt{(n-6\big\lfloor\dfrac{n}{6}\big\rfloor-1)^2}}{6}\big\rceil}$$

I can't think of simple definitions for the floor or ceiling functions ($\lfloor\;\rfloor$, $\lceil\;\rceil$) at the moment.

JMP
  • 21,771
0

If you separate the first sequence into three "multisection"-sub-sequences one gets $$ \begin{array} {l} 0, \;,\;,2,\;,\;,6,\;,\;,14, \ldots \\ \;,1,\;,\;,3,\;,\;,7,\;,\;, \ldots \\ \;,\;,2,\;,\;,6,\;,\;,14,\;,\;, \ldots \end{array}$$ An interesting (and simple) observation is then, that the differences behave like $2,4,8,...$ and possibly can be continued by $2,4,8,16,...,2^k,...$

A proposal for the continuation of the sequence is then obvious.

A generating-function $\mathcal G$ for the first subsequence were then ${2\over 1-2x^3} -{2\over 1-x^3}$ and the combination of the three subsequences should have $$ \mathcal G (x) = {x+2 x^2 + 2x^3 \over (1-x^3) (1-2x^3) } = \sum_{k=0}^\infty g_kx^k $$ and $$a_k = \mathcal g_ k $$ giving the sequence $$ 0, 1, 2, 2, 3, 6, 6, 7, 14, 14, 15, 30, 30, 31, 62, 62,...$$


A smoothing (interpolating) formula which gives each third element precisely is $$b_{k+1} = 2(\mu-1)+\mu b_k \qquad \qquad \mu=\;^3 \sqrt{2} $$ giving
b_k          a_k   (k beginning at zero)
------------------------
0.0             0
0.519842099790  1
1.17480210394   2
2.00000000000   2
3.03968419958   3
4.34960420787   6
6.00000000000   6
8.07936839916   7
10.6992084157   14
14.0000000000   14
18.1587367983   15
23.3984168315   30
30.0000000000   30
38.3174735966   31
48.7968336630   62
62.0000000000   62                 

A "perfect" formula using "round" (related to "floor")- and sine function is

$$a_k = 2^{ 1+\lbrace {k\over 3} \rbrace}-\frac43 \sin( \pi \cdot {k-1\over 3})^2-1$$ $\qquad \qquad $ where $ \lbrace x \rbrace $ means "x rounded to the nearest integer".

  • Interestingly, when I give that series up to $62,...$ into W|A it finds the above formula and displays it, but after a short time deletes that solution and gives a polynomial interpretation, where fractional values follow. Only if I give more terms, say up to $,510,...$ W|A "trusts" its initial solution... – Gottfried Helms Aug 06 '16 at 13:11
0

For case II), shift the index to start from $0$ i.e. put $n=m+1$.
Then you have a function of period $6$: $$ f\left( m \right) = \left\{ \begin{gathered} 1\quad \left| {\;\bmod \left( {m,6} \right) = 0} \right. \hfill \\ 0\quad \left| {\;\bmod \left( {m,6} \right) \ne 0} \right. \hfill \\ \end{gathered} \right. $$ There are plenty of ways to render it. Some are:
a) Floor
Delta of step functions $$ f\left( x \right) = \left\lfloor {\frac{x} {6}} \right\rfloor - \left\lfloor {\frac{{x - 1}} {6}} \right\rfloor = 1 + \left\lfloor {\frac{x} {6}} \right\rfloor - \left\lceil {\frac{x} {6}} \right\rceil \quad \Rightarrow \quad x_n = \left\lfloor {\frac{{n - 1}} {6}} \right\rfloor - \left\lfloor {\frac{{n - 2}} {6}} \right\rfloor $$

b) Discrete Fourier Transform
Taking the real part of the DFT gives: $$ f\left( x \right) = \frac{1} {6}\sum\limits_{0\, \leqslant \,k\, \leqslant \,5} {\cos \left( {\frac{{2\pi \,k\,x}} {6}} \right)} $$

c) Discrete Cosine Tranform
Applying the DCT you get instead: $$ \begin{gathered} f\left( x \right) = \frac{1} {6}\left( {1 + \cos \left( {\pi \,x} \right) + 2\cos \left( {\frac{{\pi \,x}} {3}} \right) + 2\cos \left( {\frac{{2\pi \,x}} {3}} \right)} \right) = \hfill \\ = \frac{1} {6}\left( {4\cos ^2 \left( {\frac{{\pi \,x}} {3}} \right) + 2\cos \left( {\frac{{\pi \,x}} {3}} \right) + \cos \left( {\pi \,x} \right) - 1} \right) \hfill \\ \end{gathered} $$

G Cab
  • 35,272