Count ways to write N as a sum of consecutive positive integers
Given n, count how many ways it can be written as a sum of one or more consecutive positive integers. A run of k numbers starting at a sums to k*a + k*(k-1)/2, so try each k while k*(k+1)/2 <= n and check whether a comes out a positive whole number.
No answer yet. Write the first one; the best answer gets endorsed.
