By the arithmetic-harmonic mean inequality or the Cauchy-Schwarz inequality, (k1+⋯+kn)(k11+⋯+kn1)≥n2. We must thus have 5n−4≥n2, so n≤4. Without loss of generality, we may suppose that k1≤⋯≤kn. If n=1, we must have k1=1, which works. Note that hereafter we cannot have k1=1. If n=2, we have (k1,k2)∈{(2,4),(3,3)}, neither of which work. If n=3, we have k1+k2+k3=11, so 2≤k1≤3. Hence (k1,k2,k3)∈{(2,2,7),(2,3,6),(2,4,5),(3,3,5),(3,4,4)}, and only (2,3,6) works. If n=4, we must have equality in the AM-HM inequality, which only happens when k1=k2=k3=k4=4. Hence the solutions are n=1 and k1=1, n=3 and (k1,k2,k3) is a permutation of (2,3,6), and n=4 and (k1,k2,k3,k4)=(4,4,4,4).