22. Input a positive integer $N$ into the machine shown in Figure 8, and the machine outputs a positive integer according to the program (for example, if $N=7$, the machine outputs $3 \times 7+1=22$).

If the output result is fed back into the machine and this process is repeated five times, the final output is 26, i.e.,
$$
7 \rightarrow 22 \rightarrow 11 \rightarrow 34 \rightarrow 17 \rightarrow 52 \rightarrow 26 \text {. }
$$

If a value $N$ is input, and the operation is performed six times, the final result is 1,
$$
N \rightarrow_{-} \rightarrow_{-} \rightarrow_{-} \rightarrow_{-} \rightarrow 1
$$

then the sum of all such positive integers $N$ is ( ).
(A) 73
(B) 74
(C) 75
(D) 82
(E) 83
22. E.

Starting from 1 and reasoning backwards.
Considering all possible cases, then
$$
\{1\} \rightarrow\{2\} \rightarrow\{4\} \rightarrow\{1,8\} \rightarrow\{2,16\} \rightarrow
$$
$\{4,5,32\} \rightarrow\{1,8,10,64\}$.

For example, for 2, it must be obtained from 4 (since there is no positive integer such that $3 n+1=2$), but 16 can be obtained from 32 or 5 (since $\frac{32}{2}=3 \times 5+1=16$).

By construction, the last set is the set of all numbers that can result in 1 after six operations.
Therefore, the desired result is $1+8+10+64=83$.