What numbers can be written as a sum of two or more consecutive odd numbers? I'm having trouble setting up a case and proving through induction or whether there is a better way to prove this.
 A: Every multiple of 4 works:
$$ 4n = (2n-1)+(2n+1) $$
Every odd composite number works. If $1<a<b$, then
$$ ab = (b-a+1)+(b-a+3)+\ldots+(b+a-3)+(b+a-1) $$
and the terms are odd if $a$ and $b$ are both odd.
Primes don't work, because the sum of an arithmetic series is the product of its length and its average term, and when the step size is 2 the average term is an integer.
Twice an odd number doesn't work, because then the series must either have an odd number of terms and an even average, or an even number of terms and an odd average. In both cases, the terms will be even rather than odd.
A: Hint: Fix some $n$. Find the sum of the first $n$ odd numbers, i.e.
$$1+3+\cdots+(2n-1)$$
(induction is useful for this). Then the numbers that can be written as a sum of $n$ consecutive odd numbers are the number you found above, plus $2kn$ for some integer $k$, because
$$(2k+1)+(2k+3)+\cdots+(2k+2n-1)=2kn+1+3+\cdots+(2n-1).$$
A: Clearly a sum of consecutive odd numbers is of the form $$o \,+\, o\!+\!2 \,+\, o\!+\!4 \,+\, \ldots \,+\, o\!+\!2k = ok + 2T(k) = o(k+1) + \frac{k(k+1)}{2}$$ and since every odd number is of the form $2h+1$ we find the numbers expressive as a sum of consecutive odd numbers are exactly the numbers $$\frac{(4h+k+2)(k+1)}{2}.$$
