The answer is n=1,3.
For i=1,2,…,k let d1+⋯+di=si2, and define s0=0 as well. Obviously
0=s0<s1<s2<⋯<sk, so si≥i and
di=si2−si−12=(si+si−1)(si−si−1)≥si+si−1≥2i−1.(1)
The number 1 is one of the divisors, hence we must have d1=1.
Consider d2 and s2≥2. By definition, d2=s22−1=(s2−1)(s2+1), so the numbers s2−1 and s2+1 are divisors of n. In particular, there is some index j such that dj=s2+1.
Notice that
s2+s1=s2+1=dj≥sj+sj−1;(2)
since the sequence s0<s1<⋯<sk increases, the index j cannot be greater than 2. Hence, the divisors s2−1 and s2+1 are listed among d1 and d2. Thus s2−1=d1=1 and s2+1=d2; therefore, s2=2 and d2=3. By repeating the above procedure, we can prove that di=2i−1 and si=i for i=1,2,…,k.
Suppose we already have dj=2j−1 and sj=j for all j≥i. Consider di+1=si+12−si2=si+12−i2=(si+1−i)(si+1+i), the number si+1+i is a divisor of n, so there is some index j such that dj=si+1+i.
Similarly to (2), by (1) we have
si+1+si=si+1+i=dj≥sj+sj−1(3)
since the sequence s0<s1<⋯<sk increases, (3) forces j≤i+1. On the other hand, dj=si+1+i>2i>di>di−1>⋯>d1, so j≤i+1 is not possible. The only possibility is j=i+1.
si+1+isi+12−si+1=di+1=si+12−si2=si+12−i2;=i(i+1).
By solving the equation, we get si+1=i+1 and di+1=2i+1.
As a result, the divisors of the number n must be 1,3,…,n−2,n and dk=2k−1=n, which is an odd number. Observe that dk−1=n−2 is a divisor of n, so we have n≤4. Thus the only possible n is 1 or 3. Can easily check both satisfies the desired property.