$\begingroup$

I have a challenge about a cat in a trip where he can walk in the way of $d, d+1, d+2...$ and the sum of that should give $N$, given an $N$, how many ways of chosing $d$ are posible?

Example:

$N=30$ -> $Ans=3$

$d_1=4; d_2=6; d_3=8$

For $d_1: 4 + 5 + 6 + 7 + 8 = 30$

Edit:

Another way to see it is: How many subsets in the sumation up to N are posible in the way $(\sum (d+n) - \sum(d-1))$=N