4. A The calculations required to find the value of $x$ are:
$$
\begin{array}{l}
p=105-47=58 ; q=p-31=58-31=27 ; \\
r=47-q=47-27=20 ; \\
s=r-13=20-13=7 ; t=13-9=4 ; \\
x=s-t=7-4=3 .
\end{array}
$$
(Note that the problem may be solved without finding the values of four of the numbers in the pyramid. Finding these is left as an exercise for the reader.)
4. In this partly completed pyramid, each rectangle is to be filled with the sum of the two numbers in the rectangles immediately below it.
What number should replace $x$ ?
A 3
B 4
C 5
D 7
E 12