So, you are correct in saying that the middle toy must be red. Note that we have spaces as follows:
$$ [1][2][3][4][R][6][7][8][9].$$
Because the arrangement is symmetric in color, we only care about arranging the color on one side of the $5^{th}$ slot, because this determines the coloring of the entire arrangement. For instance, if we arrange $6-9$ as
$$ [R][B][R][B]$$
the overall configuration is
$$ [B][R][B][R][R][R][B][R][B].$$
So, there are
$$ \frac{4!}{(2!)^2}=6$$
ways to arrange the colors. Then there are $5!$ ways to permute the distinct red toys, and $4!$ ways to permute the distinct blue toys. Using the product rule we have
$$ 6(5!)(4!)$$
permutations, as desired.
How many ways can five items be arranged in a row if two particular items may not be adjacent?
There are $5!$ ways of arranging items in a line.
From these arrangements, we must subtract those in which two particular items are adjacent. Place those two items in a box. That gives us four objects to arrange, the box and the other three objects. The objects can be arranged in a row in $4!$ ways. The two objects in the box can be arranged in $2!$ ways. Hence, the number of inadmissible arrangements is $4!2!$.
Therefore, the number of admissible arrangements is $5! - 4!2!$.
How many ways can five of nine items be arranged if two items can't be next to each other.
Your approach is sound. Your counts for the case neither item $A$ nor item $B$ is correct. However, your count for only item $A$ is incorrect.
If only item $A$ is used, then item $B$ is not used, so we must select four of the other $9 - 2 = 7$ objects in addition to item $A$. The five selected objects can be arranged in $5!$ ways. Hence, the number of arrangements containing only item $A$ is actually
$$\binom{1}{1}\binom{1}{0}\binom{7}{4}5!$$
By symmetry, the same number of arrangements contain only item $B$.
The two cases in which exactly one item is present can be handled simultaneously. Choose one of $A$ and $B$, four of the remaining seven objects, and arrange the selected objects in $5!$ ways, which gives
$$\binom{2}{1}\binom{7}{4}5!$$
For the case in which both item $A$ and item $B$ are selected, we must select three of the other seven objects to be in the arrangement. Once those five objects have been selected, they can be arranged in $5! - 4!2!$ ways without placing items $A$ and $B$ next to each other. Hence, there are
$$\binom{2}{2}\binom{7}{3}[5! - 4!2!]$$
ways to select five objects including $A$ and $B$ and arrange them so that $A$ and $B$ are not adjacent.
Adding the three cases gives
$$\binom{2}{0}\binom{7}{5}5! + \binom{2}{1}\binom{7}{4}5! + \binom{2}{2}\binom{7}{3}[5! - 4!2!]$$
where the first term is the number of admissible arrangements in which neither $A$ nor $B$ is selected, the second term is the number of admissible arrangements in which exactly one of $A$ or $B$ is selected, and the third term is the number of admissible arrangements in which both $A$ and $B$ are selected.
Best Answer
There are two different types of questions involved here.
The formula you used works for determining the number of proper factors of a positive integer with three distinct prime factors. If $$n = p_1^pp_2^qp_3^r$$ then each factor of $n$ has the form $$m = p_1^{j}p_2^{k}p^{l}$$ where $j \in \{0, 1, 2, \ldots, p\}$, $k \in \{0, 1, 2, \ldots, q\}$, and $l \in \{0, 1, 2, \ldots, r\}$. Hence, $j$ can be chosen in $p + 1$ ways, $k$ can be chosen in $q + 1$ ways, and $l$ can be chosen in $r + 1$ ways. Thus, $n$ has $$(p + 1)(q + 1)(r + 1)$$ factors, of which $1$ is proper. Hence, $n$ has $$(p + 1)(q + 1)(r + 1) - 1$$ proper factors.
The first question is asking for the number of proper factors of $7875$. To determine this, we first factor $7875$ into primes. \begin{align*} 7875 & = 3 \cdot 2625\\ & = 3 \cdot 3 \cdot 875\\ & = 3 \cdot 3 \cdot 5 \cdot 175\\ & = 3 \cdot 3 \cdot 5 \cdot 5 \cdot 35\\ & = 3 \cdot 3 \cdot 5 \cdot 5 \cdot 5 \cdot 7\\ & = 3^2 \cdot 5^3 \cdot 7 \end{align*} Each factor of $7875$ has the form $3^a5^b7^c$, where $a \in \{0, 1, 2\}$, $b \in \{0, 1, 2, 3\}$, and $c \in \{0, 1\}$. Hence, there are $3 \cdot 4 \cdot 2 = 18$ factors of $7875$ and $3 \cdot 3 \cdot 2 - 1 = 17$ proper factors of $7875$.
Since $30 = 2 \cdot 3 \cdot 5$, it has $2 \cdot 2 \cdot 2 - 1 = 8 - 1 = 7$ proper factors.
The second question is asking for the number of ordered triples $(a, b, c)$ of positive integers such that $abc = 30$. This is not the same thing.
In this question, each prime must appear once among the three factors. If we write \begin{align*} a & = 2^{x_1}3^{y_1}5^{z_1}\\ b & = 2^{x_2}3^{y_2}5^{z_2}\\ c & = 2^{x_3}3^{y_3}5^{z_3} \end{align*} then \begin{align} x_1 + x_2 + x_3 & = 1 \tag{1}\\ y_1 + y_2 + y_3 & = 1 \tag{2}\\ z_1 + z_2 + z_3 & = 1 \tag{3} \end{align} since each prime appears once in the factorization of $30$. Equations 1, 2, and 3 are equations in the nonnegative integers, each of which has three solutions, depending on which of the three variables is equal to $1$. Hence, there are $3 \cdot 3 \cdot 3 = 27$ such ordered triples.