Problem

Source: France 1994 P3

Tags: algebra, number theory, function



Let us define a function $f:\mathbb N\to\mathbb N_0$ by $f(1)=0$ and, for all $n\in\mathbb N$, $$f(2n)=2f(n)+1,\qquad f(2n+1)=2f(n).$$Given a positive integer $p$, define a sequence $(u_n)$ by $u_0=p$ and $u_{k+1}=f(u_k)$ whenever $u_k\ne0$. (a) Prove that, for each $p\in\mathbb N$, there is a unique integer $v(p)$ such that $u_{v(p)}=0$. (b) Compute $v(1994)$. What is the smallest integer $p>0$ for which $v(p)=v(1994)$. (c) Given an integer $N$, determine the smallest integer $p$ such that $v(p)=N$.