5. In a triangle, the three sides forming an arithmetic sequence is the ratio of the three sides being $3: 4: 5$ ( ).
(A) a sufficient but not necessary condition
(B) a necessary but not sufficient condition
(C) a sufficient and necessary condition
(D) neither a sufficient nor a necessary condition
5. B.

The three sides of a triangle are $4, 5, 6$, forming an arithmetic sequence, and their ratio is not $3: 4: 5$; conversely, if the ratio of the three sides of a triangle is $3: 4: 5$, let the two side lengths be $3k, 4k, 5k (k>0)$, then they form an arithmetic sequence with a common difference of $k$. Therefore, in a triangle, the three sides forming an arithmetic sequence is a necessary but not sufficient condition for the ratio of the three sides to be $3: 4: 5$.