Solve $f(n,p)=y$ where $(n,p,y)\in\Bbb N\times\Bbb N\times\Bbb N$

28 Views Asked by At

We define the function $f : \Bbb N \times \Bbb N \rightarrow \Bbb N$ by $f(n,p) = 2^n(2p+1)-1$. Can you help me prove this: $$\big(\forall y \in \Bbb N\big)\big(\exists(n,p)\in \Bbb N\times \Bbb N\big)\space f(n,p)=y$$

I’ve rearranged the original equation to get $$f(n,p)+1= 2^n(2p+1),$$ but I’m not sure how to continue.

If $y$ is an even number : The solution is $( 0 , y/2 )$.
If $y$ is an odd number : I do not know how we can prove that any odd number $y$ , we can type it in form $2^n(2p+1)−1$ .

Can you help me? Thank you very much.

1

There are 1 best solutions below

1
On

If $y$ is even, as you said $(0,y/2)$ is a solution. If $y$ is odd, then $y+1$ is even, then there exists $n$ such that $2^n$ divides $y+1$ but $2^{n+1}$ does not. Hence $\frac{y+1}{2^n}=m$ is odd (otherwise $2$ divides it another time and $2^{n+1}$ divides $y+1$). Since $m$ is odd, then there exists $p$ such that $m=2p+1$. Hence any odd number is of the form $2^n(2p+1)-1$ for some $n,p\in \Bbb N$.