To solve this problem, we need to determine the values of the scalars $p,$ $q,$ and $r$ that satisfy the equation
\[\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = p \mathbf{a} + q \mathbf{b} + r \mathbf{c}.\]Let's first find the dot products of $\mathbf{a},$ $\mathbf{b},$ and $\mathbf{c}$ with the given vector $\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix}.$

The dot product of $\mathbf{a}$ with $\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix}$ is
\[\begin{pmatrix} 1 \\ 1 \\ X \end{pmatrix} \cdot \begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = (-4)(1) + (7)(1) + (3)(X) = 3X + 3.\]The dot product of $\mathbf{b}$ with $\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix}$ is
\[\begin{pmatrix} 2 \\ -3 \\ 1 \end{pmatrix} \cdot \begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = (2)(-4) + (-3)(7) + (1)(3) = -29.\]The dot product of $\mathbf{c}$ with $\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix}$ is
\[\begin{pmatrix} 4 \\ 1 \\ -5 \end{pmatrix} \cdot \begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = (4)(-4) + (1)(7) + (-5)(3) = -39.\]Therefore, we must have
\[\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = (-39) \mathbf{a} - 29 \mathbf{b} + (3X + 3) \mathbf{c}.\]In other words,
\[\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = \begin{pmatrix} -39 \\ -39 \\ -39X - 39 \end{pmatrix} + \begin{pmatrix} -58 \\ 87 \\ -29 \end{pmatrix} + \begin{pmatrix} 12X + 12 \\ 3X + 3 \\ -15X - 15 \end{pmatrix}.\]Matching entries, we get
\[-4 = -39 - 58 + 12X + 12,\]so $X = \boxed{1}.$
The answer is: 1
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
The vectors $\mathbf{a} = \begin{pmatrix} 1 \\ 1 \\ X \end{pmatrix},$ $\mathbf{b} = \begin{pmatrix} 2 \\ -3 \\ 1 \end{pmatrix},$ and $\mathbf{c} = \begin{pmatrix} 4 \\ 1 \\ -5 \end{pmatrix}$ are mutually orthogonal.  There exist scalars $p,$ $q,$ and $r$ such that
\[\begin{pmatrix} -4 \\ 7 \\ 3 \end{pmatrix} = p \mathbf{a} + q \mathbf{b} + r \mathbf{c}.\]Enter the ordered triple $(p,q,r). 7. What is the value of unknown variable X?

### Answer:
