5. $a_{1}, a_{2}, \cdots, a_{6}$ are six distinct natural numbers whose sum is 23. Then, $a_{1} a_{2}+a_{2} a_{3}+\cdots+$ $a_{5} a_{6}+a_{6} a_{1}$ has the minimum value of ( ).
(A) 62
(B) 64
(C) 65
(D) 67
5. (B).

For 6 numbers whose sum is 21, arranged as shown in Figure 2, i.e., $a_{1}=1, a_{2}=6$, $\cdots, a_{6}=5$, the required "sum value" $a_{1} a_{2} +\cdots+a_{6} a_{1}$ is the smallest. At this time, the largest number 6 is surrounded by 1,2; the second largest number 5 is surrounded by 1,3; $\cdots$. Any adjustment would increase the "sum value".

Now, it is required that the sum of 6 numbers is 23, and they are all different. The added value $23-21=2$ is most suitable to be added entirely to the largest number 6: it satisfies the requirement of being all different and makes the added value $2 \times(1+2)=6$ the smallest. At this time, the "sum value" is
$$
1 \times 8+8 \times 2+2 \times 4+4 \times 3+3 \times 5+5 \times 1=64 \text {. }
$$