364. Find all natural numbers $a$ for which the number $a^{2}-10 a+21$ is prime.
$\triangle$ Let's factor this quadratic trinomial into linear factors:

$$
a^{2}-10 a+21=(a-3)(a-7)
$$

From this, it is clear that the given number is, in general, composite. When is it prime? When one of the factors is 1 and the other is a prime number, or when one of them is -1 and the other is $-p$, where $p$ is a prime number. Let's consider all cases.

1) Suppose $a-3=1$.

Then $a=4$, from which $a-7=-3$. This means that the number $a^{2}-10 a+21$ is negative. Therefore, this case is impossible.

2) Suppose $a-7=1$.

Then $a=8, a-3=5$, where $5$ is a prime number. Therefore, the value $a=8$ satisfies the requirement of the problem.

3) Let $a-3=-1$.

In this case, $a=2, a-7=-5$. Since the number $5$ is prime, the value $a=2$ also works.

4) Suppose $a-7=-1$.

Then $a=6, a-3=3$. Since here $(a-3)(a-7)<0$, this case is impossible.

Answer: $8,2$.