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$.
### Part (a)
1. **Define the function and sequence:**
   - The function \( f: \mathbb{N} \to \mathbb{N}_0 \) is defined by:
     \[
     f(1) = 0, \quad f(2n) = 2f(n) + 1, \quad f(2n+1) = 2f(n)
     \]
   - The sequence \((u_n)\) is defined by:
     \[
     u_0 = p, \quad u_{k+1} = f(u_k) \text{ whenever } u_k \ne 0
     \]

2. **Prove the existence of \( v(p) \):**
   - We need to show that for each \( p \in \mathbb{N} \), there exists a unique integer \( v(p) \) such that \( u_{v(p)} = 0 \).
   - Consider the binary representation of \( p \). Each application of \( f \) either removes the leftmost bit (if it is 1) or shifts the bits to the right and inverts them.
   - Since \( f \) reduces the number of bits in the binary representation of \( p \) by one in each step, after a finite number of steps, the sequence will reach 0.
   - Therefore, there exists a unique integer \( v(p) \) such that \( u_{v(p)} = 0 \).

\(\blacksquare\)

### Part (b)
1. **Convert 1994 to binary:**
   - \( 1994 \) in binary is \( 11111001010 \).

2. **Count the number of slugs:**
   - A slug is a sequence of consecutive same-valued bits.
   - The binary representation \( 11111001010 \) has six slugs: \( (11111, 0, 0, 1, 0, 10) \).

3. **Determine \( v(1994) \):**
   - Since \( 1994 \) has six slugs, \( v(1994) = 6 \).

4. **Find the smallest integer \( p > 0 \) for which \( v(p) = 6 \):**
   - The smallest six-slug number is \( (1, 0, 1, 0, 1, 0) \) in binary, which is \( 42 \).

\(\boxed{42}\)

### Part (c)
1. **Determine the smallest integer \( p \) such that \( v(p) = N \):**
   - The smallest \( N \)-slug number is \( p = (1, 0, 1, 0, \ldots) \) with \( N \) slugs.
   - If \( N \) is even, the smallest \( N \)-slug number is \( \frac{2^{N+1} - 2}{3} \).
   - If \( N \) is odd, the smallest \( N \)-slug number is \( \frac{2^{N+1} - 1}{3} \).

2. **General formula for \( p \):**
   - Irrespective of \( N \), the smallest \( N \)-slug number is:
     \[
     p = \left\lfloor \frac{2^{N+1} - 1}{3} \right\rfloor
     \]

\(\boxed{\left\lfloor \frac{2^{N+1} - 1}{3} \right\rfloor}\)