Let, by condition,
n=29q1+r1=41q2+r2=59q3+r3=r1+r2+r3,
r1<29, r2<41, r3<59. From these inequalities it follows that 59q3=r1+r2≤28+40=68, so q3=1. Then
r1+r2=59.(1)
Further, 41q2=r1+r3≤28+58=86, so q2≤2. Consider two cases:
1)q2=1.Thenr1+r3=41.(2)
From (1) and (2) it follows that
100=59+41=r1+r2+r1+r3=n+r1=29q1+2r1,
i.e., 29q1+2r1=100. Hence q1 is even and 29q1<100, so q1=2. Then r1=21(100−2⋅29)=21, r2=38, r3=20, and n=21+38+20=79, which satisfies the problem condition.
2) q2=2. Then
r1+r3=n−r2=41q2=82.(3)
From (1) and (3) it follows that 29q1+2r1=141, so q1 is odd and 29q1<141. Hence either q1=1 or q1=3. If q1=1, then 2r1=122, i.e., r1=61, a contradiction. If q1=3, then r1=27, r2=32, r3=55, and n=27+32+55=114, which satisfies the problem condition.