Let Sk=∑j=1nxjk, so S1=S2=⋯=Sn−1=1,Sn=2, and Sm=4. The first of these conditions gives that x1,…,xn are the roots of P(x)=xn−xn−1−c for some constant c. Then xin=xin−1+c, and thus 2=Sn=Sn−1+cn=1+cn so c=n1. Thus, we have the recurrence Sk=Sk−1+nSk−n. This gives Sn+j=2+nj for 0≤j≤n−1, and then S2n=3+n1. Then S2n+j=3+n2j+1+2n2j2+j for 0≤j≤n−1. In particular, S3n−1>4, so we have m∈[2n,3n−1]. Let m=2n+j. Then 3+n2j+1+2n2j2+j=4⟹2n2−2n(2j+1)−(j2+j)=0 Viewing this as a quadratic in n, the discriminant 4(2j+1)2+8(j2+j)=24j2+24j+4=4(6j2+6j+1) must be a perfect square, so 6j2+6j+1 is a square. Then 6j2+6j+1=y2⟹12j2+12j+2=2y2⟹3(2j+1)2−2y2=1 The case j=0 gives n=1, a contradiction. After this, the smallest j that works is j=4 (and y=11 ). Plugging this back into our quadratic, 2n2−18n−20=0⟹n2−9n−10=0 so n=10. Then m=2n+j=24, so m+n=34.