- #26

- 96

- 42

**11.**Show that the number of ways to express a positive integer ##n## as the sum of consecutive positive integers is equal to the number of odd factors of ##n##.

I am forced to assume that @fresh_42 meant to say "number of odd factors

**other than (i.e. excluding)**1", because otherwise it is easy to find counter-examples. There is just one way to write 6 as a sum of consecutive natural numbers (##1+2+3##) even though it has two odd factors, 1 and 3.

I am giving below one way to prove the claim stated in the question, but the proof isn't rigorous. I will work out the finer details and post it later when I have some free time.

**Observation 1:**Any odd natural number ##y >= 3## can be written as a sum of 2 consecutive positive integers, ##(y -1)/2## and ##(y+1)/2##

**Observation 2:**If a sequence of consecutive natural numbers is an odd-length sequence "centered" at an integer ##x## (e.g. ##4, 5, 6## is centered at ##x=5## and is of length 3), then the sequence's sum is ##x * lengthOfSequence##. The length of such an odd-length sequence can be denoted by ##(2k + 1)##. ##k## will be the count of numbers to the left of ##x## and also the count of numbers to the right of ##x##. It is easy to see that every pair of numbers that are at the same offset to the left and to the right of ##x## in the sequence will add up to ##2x## and the sum is ##(2k+ 1)*x##.

**Observation 3:**If such an odd-length sequence is centered at an odd number and the sequence starts sufficiently away from 1 (away-ness dependent on ##k##, need to work out the exact formula), then it can be transformed or broken down to an even-length sequence of consecutive natural numbers that is double the length but adds up to the same sum as the original sequence; this even-length sequence will be centered around 2 consecutive numbers derived from the original center ##x## as per observation 1. E.g. ##(6 + 7 + 8) \equiv ((1+2)+(3+4)+(5+6)) \equiv 21##

**Observation 4:**If the consecutive numbers sequence is of even-length or if it centered at an even number, then there is no transformation to a longer sequence of consecutive numbers (like that in previous observation) that adds up to same sum.

Now suppose there are ##m## distinct ways to factorize ##n## as a multiple of 2 numbers and they are represented as ##a_{1} \times b_{1}, a_{2} \times b_{2}, ..., a_{m} \times b_{m}## where ##a_{i} <= b_{i}##. Also we order then such that ##a{1} < a_{2} < ... < a_{m}##. We can map each such pair to atmost two unique sequences of consecutive natural number that add up to ##n##. The mapping will be as follows:

- If ##a_{1} = 1##, then we can map to just one sequence, ##(b{1} -1)/2 + (b{1} +1)/2##, provided ##b## is odd. No mapping if ##b_{1} = n## is even
- If ##a_{i} and b_{i}## are even, then no mapping
- If both ##a_{i}## and ##b_{i}## are odd, then we map to ##(b_{i} - ((a_{i}-1) \div 2)), (b_{i} - ((a_{i}-1) \div 2) +1), .., b_{i}, (b_{i} + 1), .., (b_{i} + ((a_{i}-1) \div 2))##, i.e. an odd-length sequence centered at an odd number. This sequence can be broken down to another sequence based on obsrvation 3, so we get 2 mappings
- If only one ##a_{i}## and ##b_{i}## is odd, then only one mapping is possible