# The Horror of the Nested Sum

**Discrete Mathematics**Level 5

A nested sum is one in which one summation is inside another. Let the function \(f(m,n)\) be equal to the nested sum \[\displaystyle \sum_{a_1=1}^{m} \left(\displaystyle \sum_{a_2=1}^{a_1} \left(\displaystyle \sum_{a_3=1}^{a_2} \left(\cdots \left(\displaystyle \sum_{a_{n-1}=1}^{a_{n-2}} \left(\displaystyle \sum_{a_n=1}^{a_{n-1}} a_n\right)\right)\cdots\right)\right)\right).\] For how many values of \(n\leq 1000\) will \(f(m,n)|f(m+1,n)\) if \(m=11\)?