# "Binary-Like" Function?; In Consecutive Products as Multi-Factorials....

## Summary

Is there a function $Z(a,b)$ or how would one find such a function so that for $a,b\in \mathbb N$, it would produce $0$'s on for each $a$th step for each $b$th value?

For example:
$a=2$, and for $b=1,2,3,4,5...$ the $Z(a,b)$ is: $0,1,0,1,0,1,0,1,0,1....$
$a=3$, and for $b=1,2,3,4,5...$ the $Z(a,b)$ is: $0,1,1,0,1,1,0,1,1....$
$a=4$, and for $b=1,2,3,4,5...$ the $Z(a,b)$ is: $0,1,1,1,0,1,1,1,0...$

And so on.

## Introduction

Consider a sequence: $(n-1)(n-2)(n-3)...(n-k)$ where $n,k \in \mathbb{N}$

First we set $k$ to define the length of the sequence; then calculate $n$ like:

1) If $(n\le k)$ then it is equal to $0$
2) If $(n\gt k)$ then it is equal to $\frac{(n-1)!}{(n-k-1)!}$

The sequence can also be written using the product notation as: $\prod ^k _{x=1} (n-x)$

Then we can consider a sequence: $(n-1)(n-3)(n-5)...(n-k)$
Where $k$ is $2m-1$, $m$ being number of the term in the sequence.

I have found the following identities for choosing $k$ :

1) If $(n\lt k)$ then is is equal to: $(n-1)!!\times[-(k-n)!!]\times \frac{1}{2}[1+(-1)^n]$
Using Double Factorial.

2) If $(n=k)$ then it is $0$

3) If $(n\gt k)$ then it is equal to: $\frac{(n-1)!!}{(n-k-2)!!}$

Also write the sequence with: $\prod ^m _{x=1} (n-2x+1)$

Note, the last term in the 1) case can be written like $\frac{1}{2}(1+e^{i \pi n})$ since $n\gt 0$

Now I've tried to generalize this for sequences: $(n-1)...(n-k)$
Where $k= am-a+1$ Where $m$ is the number of the term, and $a$ the "Step" between the terms.

In our first two sequences we have $a=1$ and $a=2$

Note, sequence can also be written like: $\prod ^m _{x=1} (n-ax-a+1)$

First we define the sequence by choosing $a,k \in \mathbb{N}$ then we can claculate values for $n \in \mathbb{N}$ following, using Multi-Factorial:

1) When $(n\lt k)$ then: $$(n-1)!^a\times [-(k-n)!^a] \times Z(a,n)$$

Where $Z(a,n)$ would be a function that will output $0$ for every $a$th value and $1$ otherwise based on value of $n$.

For example; $a=2$ then for: $n=1,2,3,4...$, Function will be: $Z(a,n)= 0,1,0,1...$
Or; $a=3$ for: $n=1,2,3,4,5,6...$, Function will be: $Z(a,n)= 0,1,1,0,1,1...$

2) When $(n= k)$ then it is 0.

3) When $(n\gt k)$ then: $$\frac{(n-1)!^a}{(n-k-a)!^a}$$

## Question

Now, how would one find such a function as $Z(a,n)$ ?

In addition, if there is a better way to write some of these things that would be good to know.

• Apr 9 '16 at 12:05
• It seems you have already defined the function $Z(a,n)$. Are you looking for ways to write $Z(a,n)$ as an expression involving other known functions? Apr 9 '16 at 12:30
• Yes, like for example $\frac{1}{2}(1+e^{i \pi n})$ is just a "shortened" expression for $Z(2,n)$. How would a expression for the whole $Z(a,n)$ function look like is my main point. Apr 9 '16 at 12:32

My comments from the other question apply here as well. But we actually can define $Z(a,n)$ even with such a mild class of functions as one including the ceiling function, addition, subtraction, and division.
$$Z(a,n) = \left\lceil \frac {n-1}a - \left\lceil \frac{n-1}{a} \right\rceil \right\rceil.$$
Actually, the example you gave in the comments extends as well, if you allow yourself interval-type $\sum$-schema, smooth functions, and the complex numbers. $$Z(a,n) = 1-\frac1a\sum_{k=1}^{a-1}\exp\left(2\pi i\frac{k(n-1)}{a}\right)$$ It's not as clear why this one works, but try it out :)
• I actually found a simple expression I belive, when considering $0^0=1$, we can write: $Z(n,a)= 1-0^{[(n-1)\mod a]}$ Apr 9 '16 at 14:41