## Recommended Posts

Part 1:

About the same time that I discovered how to modify a function as to only affect a single output, I also discovered a way to produce the following sequence using only elementary operators {+, -, *, / and ^}:

{1, 1, 2, 2, 3, 3, 4, 4, etc...}

I do realize that a solution could be found using the floor and ceiling operators, but that will not be accepted for the answer. As in my first challenge, you are only allowed to use addition, subtraction, multiplication, division and exponents. No other operators are allowed. Also the function is restricted to the set of integers.

Because the domain can be shifted to start with whatever input you choose, I will accept any solution that produces the above sequence that only uses the elementary operators stated previously.

Part 2:

I will also give a five star rating and reputation to the person who can give me a single solution for the following sequences where the values are repeated according to $2^x$:

{1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, etc...}

{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, etc...}

{1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, etc...}

The solution that I am looking for in this case uses the elementary operators as stated for part 1 in conjunction with the series operators, $\Sigma$ and $\Pi$. I will also accept a solution using $\Sigma$, $\Gamma$, factorials, or Pochhammer.

I will give this challenge a few weeks before posting the solution unless someone solves it or requests more time : )

Edited by Daedalus
##### Share on other sites

First one:

I'm going to assume the sequence starts at 0, and give the sequence {0,0,1,1,2,2,...}, or in other words, floor(x/2); it should be clear how that can generalize.

First, we get the function {0,1,0,1,...} as follows:

(1 - (-1)^(x))/2.

Then we get the function {0,0,2,2,4,4,...} as follows:

x - (1 - (-1)^(x))/2.

Then to get the final thing, we get

(x - (1 - (-1)^(x))/2)/2.

Alternatively:

x/2 - 1/4 + (-1)^x/4.

That's part 1.

=Uncool-

##### Share on other sites
• 2 weeks later...

Since noone has solved the second part of my challenge, I will post the answer.

Uncool solved the first part using the following "odd / even" equation:

$\frac{1-(-1)^x}{2}$

The above equation produces a zero if $x$ is an even integer, and one if $x$ is an odd integer. We can arrive at the solution uncool derived by solving the equation which predicts the summation of the above equation:

$\sum_{x=0}^n \frac{1-(-1)^x}{2}=\frac{ 2\, n - (-1)^n + 1}{4}$

To obtain the equation which gives us the rest of the sequences we must first derive an equation which produces the Sierpinski triangle. This can be done if we apply the odd / even function to continued summations of $x$. Basically, we sum the sequence produced by $f(x)=x$. Then, we continue to sum the new sequence to produce the next sequence:

$F(S, n)=\sum_{j_{1}=1}^n \sum_{j_{2}=1}^{j_{1}} ... \sum_{x=1}^{j_{S}} (x)$

The Sth summation of $x$ from 1 to $n$ can be generalized as follows:

$F(0, n)=\sum_{x=1}^n 1=n$

$F(1, n)=\sum_{x=1}^n x=\frac{n\, (n+1)}{2}$

$F(2, n)=\sum_{x=1}^n \frac{x\, (x+1)}{2}=\frac{n\, (n+1)\, (n+2)}{6}$

$F(S, n)=\prod_{j=0}^S \frac{n+j}{j+1}=\frac{\Gamma(S + n + 1)}{\Gamma(n) \, \Gamma(S + 2)}=\frac{\left \langle n \right \rangle_{S+1}}{(S+1)!}$

$\left \langle x \right \rangle_{n}$ seen used in the above equation is the rising factorial or Pochhammer symbol. I prefer this notation instead of the other variations so that it is not confused with powers / exponents.

$F(S, n)$ produces the following sequences:

$F(0, \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\})=\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$

$F(1, \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\})=\{0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55\}$

$F(2, \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\})=\{0, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220\}$

Plugging this result into the "odd / even" function produces a series of ones and zeroes which gives us the Sierpinski triangle:

$\frac{1-(-1)^{F(S, n)}}{2}$

which produce the following sequences (we start with $S=-1$ and $n=1$ so that we can see the triangle):

$F(-1, \{...\})=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,...\}$

$F(\ \ \, 0, \{...\})=\{1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,...\}$

$F(\ \ \, 1, \{...\})=\{1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,...\}$

$F(\ \ \, 2, \{...\})=\{1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,...\}$

$F(\ \ \, 3, \{...\})=\{1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,...\}$

$F(\ \ \, 4, \{...\})=\{1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,...\}$

$F(\ \ \, 5, \{...\})=\{1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,...\}$

$F(\ \ \, 6, \{...\})=\{1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,...\}$

Now if you want the actual triangle pattern you will need to shift $n$ by $-(S+1)$:

$\frac{1-(-1)^{F(S, \,n-(S+1))}}{2}$

But, we can see from the above sequences that $F(0, n)$ produces the double counting sequence from the first part of my challenge. We can also see that $F(2, n)$ produces the second sequence because it generates a one followed by three zeroes and repeats. $F(6, n)$ produces the third sequence because it generates a one followed by seven zeroes and repeats. etc...

We can see from the Sierpinski triangle that the sequences we want occurr at the following values of $S$:

$\{0, 2, 6, 14, 30, 62, ...\}$

The equation which predicts these sequences is $2^{m+1}-2$ starting with $m=0$. Substituting this equation for $S$ and summing the result gives us the solution for part two:

$G(m, n)=\sum_{j=0}^n \frac{1-(-1)^{F(2^{m+1}-2,\,j)}}{2}=\sum_{j=0}^n \frac{1-(-1)^{\frac{\Gamma(2^{m+1}+j-1)}{\Gamma(j)\, \Gamma(2^{m+1})}}}{2}$

Interestingly enough, continued summations of $x^p$ produce the same result. I solved this equation when I was in the 11th grade in high school. The following is a generalized equation which produces the polynomials that predict the Sth summation of $x^p$ from 1 to $n$, where $p$ is any natural number not including zero:

$F(S,\, n,\, p)=\sum_{j_{1}=1}^n \sum_{j_{2}=1}^{j_{1}} ... \sum_{x=1}^{j_{S}} (x^p)=\sum_{j=0}^p \left((-1)^{j+p} \left(\sum_{k=0}^j \frac{k^p \, \left \langle -j \right \rangle_{j-k}}{(j-k)!}\right)\left(\frac{\left \langle n \right \rangle_{j+s}}{(j+s)!} \right)\right)$

Mathematica implements the rising factorial, $\left \langle x \right \rangle_{n}$ , using:

$\text{Pochhammer}[x, n]$

Edited by Daedalus

## Create an account

Register a new account