How to prove the fundamental period of a periodic sequence?

134 Views Asked by At

The following is a simpler version of the problem at hand.

Lets say we have a periodic function $f$ which has a fundamental period $p>1$. That is, for any $n \in \mathbb{N}$, $$f(n) = f(n+p).$$ Similarly, we have two other periodic functions $g$ and $h$ such that for any $n \in \mathbb{N}$, $$g(n) = g(n+a), \quad h(n) = h(n+b),$$ where $a,b>1$ are the fundamental periods for $g$ and $h$, respectively. Additionally, we know $a$ and $b$ are coprime and $g(n) = h(n)$ only if $g(n) = 0 = h(n)$. The function $f$ is defined as $$f(n) = \begin{cases} g(n), & g(n) \neq 0; \\ h(n), & g(n) = 0. \\ \end{cases}$$ My question is: What is the fundamental period of $f$ in terms of $a$ and $b$? Or how do I prove what the fundamental period is?

My attempt: I've shown that $p \le ab$ by $$f(n) = \begin{cases} g(n), & g(n) \neq 0; \\ h(n), & g(n) = 0, \\ \end{cases} = f(n + ab) = \begin{cases} g(n+ab), & g(n+ab) \neq 0; \\ h(n+ab), & g(n+ab) = 0. \\ \end{cases}$$ Also, I noticed that for all $n \in \mathbb{N}$, $$f(n)=g(n) = g(n+a) \text{ or } f(n) = h(n) = h(n+b)$$ and $$g(n) \neq 0 \implies g(n) \neq h(n+b) \text{ and } h(n) \neq g(n+a).$$ From here, I am not sure where to go.