Let $P_0, P_1, P_2$ be the vertices of a given triangle. I'm interested in finding $K$ points $P_3, P_4, .... P_{K+2}$ that lie inside the triangle and minimize the total distance given by the expression $\sum_{i=3}^{K+2} \sum_{j=0, j \neq i}^{K+2} (P_i - P_j)^2 $.
This is basically the sum of distances of points $P_3, P_4, .... P_{K+2}$ to all the other points.
When $K = 3$, the solution is the barycenter of the triangle. I'm interested in finding the solution using an analytical approach when $K > 3$.
EDIT: Distance should be $D = \sum_i min_{i\neq j}|| P_i - P_j||^2 $. The objective is to "maximally spread" the points inside the triangle as pointed out in the first answer. For that $D$ has to be maximized.