This proof is modeled after Andrew Weimholt's proof that A326344 has maximum value 909. Each term in the sequence has two possible successors, so the possible values of a(n) can be visualized as a binary tree. However, since n is prime only if n is congruent to +- 1 mod 6, we can significantly restrict the number of possibilities. The sequence begins in single digits, and we will show that it always returns to single digits, with 20 being the maximum value. From single digits, a(n) can only take on double digits when a(n) = 11_3 = 4_10, and n must be composite. It will suffice to check the four cases of n mod 6 = 0, 2, 3, and 4. The following tables continue until 3- or 1-digit numbers are obtained. All elements of the sequence on the right-hand side are written in base 3. n mod 6 ---------------- 0 11 1 [2] --- 21 2 22 3 [1] n mod 6 ---------------- 2 11 3 [2] n mod 6 ---------------- 3 11 4 [2] n mod 6 ---------------- 4 11 5 [2] --- 21 0 22 1 [1] --- [201] 201_3 = 11_10 occurs only at n mod 6 = 1, so we start from there: n mod 6 ---------------- 1 201 2 202 (= 20_10) 3 12 4 2 Therefore every transition from a single digit to two digits is eventually followed by a return to single digits, or a transition to three digits which is then followed by a return to one digit after reaching a maximum of 20_10. It follows that the highest reachable number is 20_10. Since a(8) = 20_10, this is the true maximum.