How many arrangements of the $26$ letters of the alphabet contain neither "math" nor "the"?
Let $S$ denote the set of all permutations of the alphabet; let $M$ denote the set of all permutations of the alphabet that contain the subsequence math; let $T$ denote the set of all permutations of the alphabet that contain the subsequence the.
We wish to count all permutations in the alphabet that contain neither the subsequence math nor the subsequence the. That is, we wish to count the number of elements in the set $M^C \cap T^C$.
Since $M^C \cap T^C = S - [M \cup T]$, $$|M^C \cap T^C| = |S| - |M \cup T|$$ By the Inclusion-Exclusion Principle, $$|M \cup T| = |M| + |T| - |M \cap T|$$ Hence, $$|M^C \cap T^C| = |S| - |M| - |T| + |M \cap T|$$ You correctly found that \begin{align*} |S| & = 26!\\ |M| & = 23!\\ |T| & = 24!\\ |M \cap T| & = 22! \end{align*} Hence, $$|M^C \cap T^C| = 26! - 23! - 24! + 22!$$
Where did you go wrong?
You added the number of sequences that do not contain the subsequence math, the number of subsequences that do not contain the word the, and the number of subsequences that contain both math and the, that is, $$|M^C| + |T^C| + |M \cap T|$$ Draw a Venn diagram as follows: Draw a rectangle that includes two overlapping circles. The rectangle represents the set $S$ of all permutations of the alphabet. Label one of the circles, say the one on the left, $M$. It represents the set of sequences that contain the subsequence math. Label the other circle $T$. It represents the set of sequences that contain the subsequence the. The region where the two circles intersect is $M \cap T$. The region inside the rectangles but outside the circles is $M^C \cap T^C$, which is what we want to count since is the set of sequences in $S$ that contain neither the subsequence math nor the subsequence the.
If we shade $M^C$ [with, say, lines from the lower left to the upper right], we shade everything in $S$ except for $M$. Thus, we have already shaded $M^C \cap T^C$ and the part of set $T$ outside $M$. If we now shade $T^C$ [with, say, lines from the upper left to the lower right], we shade everything in $M^C \cap T^C$ again and the region of $M$ outside $T$. We then shade $M \cap T$ [with, say, horizontal lines]. Notice that we have now shaded $M \cup T$ once and $M^C \cap T^C$ twice. Put another away, we have shaded all of $S$ once and then shaded $M^C \cap T^C$ a second time. Consequently, what you counted is $$|M^C| + |T^C| + |M \cup T| = |S| + |M^C \cup T^C|$$ Using my answer above for $|M^C \cap T^C|$, we obtain $$|S| + |M^C \cap T^C| = 26! + 26! - 23! - 24! + 22!$$ which explains why you have an extra $26!$ term in your answer.