I ran into a problem where I need to represent this sequence:
$$0,0,1,1,2,2,3,3,4,\ldots$$
and this one too:
$$6,5,5,4,4,3,3,2,2 \ldots$$
But I am not sure how to represent them in a compact way.
I ran into a problem where I need to represent this sequence:
$$0,0,1,1,2,2,3,3,4,\ldots$$
and this one too:
$$6,5,5,4,4,3,3,2,2 \ldots$$
But I am not sure how to represent them in a compact way.
On
You could for example define it recursively. Set $a_0 = a_1 = 0$ and $a_{i+1} = a_{i-1} + 1$ for $i \geq 1$.
And of course similarly for the other one.
On
Consider $a_n=\big\lfloor\frac{n}2\big\rfloor$ for $n\geqslant 0$, where $\lfloor x\rfloor$ is the floor-function.
On
Here's an alternative:
$$a_n=\dfrac n2+\dfrac{(-1)^n-1}4;$$
$$b_n=6-\dfrac n2+\dfrac{(-1)^n-1}4.$$
On
Your two sequences are instances of an interleave sequence. Thus, you could introduce a specific notation for the interleave sequence of two sequences $u_n$ and $v_n$, say $\operatorname{Inter}(u_n,v_n)$ and define your first sequence as $\operatorname{Inter}(n,n)$ and the second one as $\operatorname{Inter}(6-n,5-n)$.
For $a_n$ and $6-a_n$ terms as I said in the comment: "Have a look at the 'floor' and 'ceiling' functions, and consider $\lfloor n/2 \rfloor$ for values of $n$"
For a different strategy, if $$\frac{1}{(1-x)^2} = 1+2x + 3x^2 + 4x^3 + \cdots$$ in terms of generating functions you want to copy this, so you can get $$\frac{x}{(1-x^2)^2} = x + 2x^3 + 3x^5 + \cdots$$ and the shifted version $$\frac{x^2}{(1-x^2)^2} = x^2 + 2x^4 + 3x^6 + \cdots$$ so 'gluing them together' and again shifting the whole sequence up $$ G_1(x) = \frac{x^2+x^3}{(1-x^2)^2} =0x^0 + 0x^1 + 1x^2 + 1x^3 + 2x^4 + 2x^5 + 3x^6 + 3x^7 + \cdots $$ which is the generating function for the sequence $0,0,1,1,2,2,3,3,4,4$ for example. The inverse Z-transform of $G(\frac{1}{x})$ will give the sequence coefficient function $a_n$, (with an extra factor of $n!$ if an exponential generating function is used), so this can be used for more challenging sequences.
For the next one you want to subtract your sequence from the all 6's sequence $6,6,6,6,6,6, \cdots$
Consider $$ 6 + 6x + 6x^2 + 6x^3 + \cdots = \frac{6}{1-x} $$ then consider the series of $$ G_2(x) = \frac{6}{1-x} - \frac{x^2+x^3}{(1-x^2)^2} $$ and to give you an example of the inverse Z-transform in action $$ \mathcal{Z}^{-1}[G_2(1/x)](n) = \frac{1}{4} \left(-2 n+(-1)^{n+1}+25\right) $$ whose terms from $n=1,2,3, \cdots$ start $6, 5, 5, 4, 4, 3, 3, 2, 2, 1, \cdots$. I calculated that using Mathematica, which has Z-transform and inverse Z-transform functions which are generally quite good.