Let $E(n)$ count the number of ternary $n$-strings with even sum, and let $e(n)$ count the number of binary $n$-strings, using just the digits $1$ and $2$, with even sum. You want a formula for
$$f(n)=E(n)-e(n)$$
We first note that $e(n)=2^{n-1}$, since the parity of the last digit is determined by the choice of the first $n-1$ digits. As for $E(n)$, if we let $O(n)$ count the number of ternary $n$-strings with odd sum, we see that
$$E(n)=2E(n-1)+O(n-1)=2E(n-1)+(3^{n-1}-E(n-1))=E(n-1)+3^{n-1}$$
Putting these together, we have
$$\begin{align}
f(n)&=E(n)-2^{n-1}\\
&=E(n-1)+3^{n-1}-2^{n-1}\\
&=E(n-1)-2^{n-2}+2^{n-2}+3^{n-1}-2^{n-1}\\
&=f(n-1)+3^{n-1}-2^{n-2}
\end{align}$$
As a sanity check, we know that $f(1)=1$, so we get
$$\begin{align}
f(2)&=1+3-1=3\\
f(3)&=3+9-2=10
\end{align}$$
which can be easily checked by hand. (I find it extremely helpful to run sanity checks, because I almost always make at least one mistake when first deriving a formula. This case was no exception.)
Remark: Once you have the recursive formula $f(n)=f(n-1)+3^{n-1}-2^{n-2}$, it's not hard to prove (by induction) the formula $f(n)=(3^n-2^n+1)/2$ (see Jack D'Aurizio's answer):
$$\begin{align}
f(n)&={3^{n-1}-2^{n-1}+1\over2}+3^{n-1}-2^{n-2}\\
&={3^{n-1}-2^{n-1}+1+2\cdot3^{n-1}-2^{n-1}\over2}\\
&={(1+2)3^{n-1}-2\cdot2^{n-1}+1\over2}\\
&={3^n-2^n+1\over2}
\end{align}$$
Let's confirm your solution.
There are $10^9$ strings of length $9$ that can be formed by using the ten decimal digits with repetition. From these, we must exclude those strings in which at least one odd digit is missing.
Let $A_i$ be the set of outcomes in which the digit $i$ is excluded, where $i \in \{1, 3, 5, 7, 9\}$.
Then, by the Inclusion Principle, the number of strings in which at least one odd digit is missing is
$$\sum_{i} |A_i| - \sum_{i < j} |A_i \cap A_j| + \sum_{i < j < k} |A_i \cap A_j \cap A_k| - \sum_{i < j < k < l} |A_i \cap A_j \cap A_k \cap A_l| + \sum_{i < j < k < l < m} |A_i \cap A_j \cap A_k \cap A_l \cap A_m|$$
$|A_1|$: Since $1$ is excluded each of the nine positions in the string can be filled in nine ways. Hence, $|A_1| = 9^9$. By symmetry,
$$|A_1| = |A_3| = |A_5| = |A_7| = |A_9|$$
$|A_1 \cap A_3|$: Since both $1$ and $3$ are excluded, each of the nine positions in the string can be filled in eight ways. Hence, $|A_1 \cap A_3| = 8^9$. By symmetry,
$$|A_1 \cap A_3| = |A_1 \cap A_5| = |A_1 \cap A_7| = |A_1 \cap A_9| = |A_3 \cap A_5| = |A_3 \cap A_7| = |A_3 \cap A_9| = |A_5 \cap A_7| = |A_5 \cap A_9| = |A_7 \cap A_9|$$
$|A_1 \cap A_3 \cap A_5|$: Since $1$, $3$, and $5$ are all excluded, each of the nine positions in the string can be filled in seven ways. Hence, $|A_1 \cap A_3 \cap A_5| = 7^9$. By symmetry,
$$|A_1 \cap A_3 \cap A_5| = |A_1 \cap A_3 \cap A_7| = |A_1 \cap A_3 \cap A_9| = |A_1 \cap A_5 \cap A_7| = |A_1 \cap A_5 \cap A_9| = |A_1 \cap A_7 \cap A_9| = |A_3 \cap A_5 \cap A_7| = |A_3 \cap A_5 \cap A_9| = |A_3 \cap A_7 \cap A_9| = |A_5 \cap A_7 \cap A_9|$$
$|A_1 \cap A_3 \cap A_5 \cap A_7|$: Since $1$, $3$, $5$, $7$, and $9$ are all excluded, each of the nine positions in the string can be filled in six ways. Hence,
$|A_1 \cap A_3 \cap A_5 \cap A_7| = 6^9$. By symmetry,
$$|A_1 \cap A_3 \cap A_5 \cap A_7| = |A_1 \cap A_3 \cap A_5 \cap A_9| = |A_1 \cap A_3 \cap A_7 \cap A_9| = |A_1 \cap A_5 \cap A_7 \cap A_9| = |A_3 \cap A_5 \cap A_7 \cap A_9|$$
$|A_1 \cap A_3 \cap A_5 \cap A_7 \cap A_9|$: Since $1$, $3$, $5$, $7$, and $9$ are all excluded, each of the nine positions in the string can be filled in five ways. Hence, $|A_1 \cap A_3 \cap A_5 \cap A_7 \cap A_9| = 5^9$.
Thus, by the Inclusion-Exclusion Principle, the number of strings of length $9$ in which at least one odd digit is missing is
$$5 \cdot 9^9 - 10 \cdot 8^9 + 10 \cdot 7^9 - 5 \cdot 6^9 + 5^9$$
Therefore, the number of strings of length $9$ in which no odd digits are missing is
\begin{align*}
10^9 - (5 \cdot 9^9 - 10 \cdot 8^9 + 10 \cdot 7^9 - 5 \cdot 6^9 + 5^9) & = 10^9 - 5 \cdot 9^9 + 10 \cdot 8^9 - 10 \cdot 7^9 + 5 \cdot 6^9 - 5^9\\
& = \binom{5}{0}10^9 - \binom{5}{1}9^9 + \binom{5}{2}8^9 - \binom{5}{3}7^9 + \binom{5}{4}6^9 - \binom{5}{5}5^9\\
& = \sum_{k = 0}^{5} (-1)^{k} \binom{5}{k}(10 - k)^9
\end{align*}
where $\binom{5}{k}$ is the number of ways of excluding $k$ of the $5$ odd digits and $(10 - k)^9$ is the number of ways of filling the nine positions of the string with the remaining $10 - k$ decimal digits.
Best Answer
To count even weight strings, you can choose the first $9$ digits arbitrarily ($4^9$ ways to do this); and then you will have two choices for the last digit so as to make the sum even.
So half the strings have even weight.