Let $a_1 = 2,$ and for $n\ge 1,$ let $a_{n+1} = 2a_n + 1.$ Find the smallest value of an $a_n$ that is not a prime number.
To find the smallest value of \(a_n\) that is not a prime number, we start by calculating the first few terms of the sequence defined by \(a_1 = 2\) and \(a_{n+1} = 2a_n + 1\).

1. Calculate \(a_1\):
   \[
   a_1 = 2
   \]
   Since 2 is a prime number, we move to the next term.

2. Calculate \(a_2\):
   \[
   a_2 = 2a_1 + 1 = 2 \cdot 2 + 1 = 5
   \]
   Since 5 is a prime number, we move to the next term.

3. Calculate \(a_3\):
   \[
   a_3 = 2a_2 + 1 = 2 \cdot 5 + 1 = 11
   \]
   Since 11 is a prime number, we move to the next term.

4. Calculate \(a_4\):
   \[
   a_4 = 2a_3 + 1 = 2 \cdot 11 + 1 = 23
   \]
   Since 23 is a prime number, we move to the next term.

5. Calculate \(a_5\):
   \[
   a_5 = 2a_4 + 1 = 2 \cdot 23 + 1 = 47
   \]
   Since 47 is a prime number, we move to the next term.

6. Calculate \(a_6\):
   \[
   a_6 = 2a_5 + 1 = 2 \cdot 47 + 1 = 95
   \]
   We need to check if 95 is a prime number. To do this, we check for divisibility by prime numbers less than \(\sqrt{95}\).

   - 95 is odd, so it is not divisible by 2.
   - The sum of the digits of 95 is \(9 + 5 = 14\), which is not divisible by 3, so 95 is not divisible by 3.
   - 95 ends in 5, so it is divisible by 5.

   Since 95 is divisible by 5, it is not a prime number.

Therefore, the smallest value of \(a_n\) that is not a prime number is \(a_6 = 95\).

The final answer is \(\boxed{95}\).