## Trending News

# How many numbers from 1 to 100 cannot be the sum of n consecutive odd numbers?

where n > 1

I mean to say, for "any" n > 1. What numbers just cannot be expressed as a sum of consecutive odd numbers?

That's terrific Dr D! Can you work this out for numbers 1 to 1000?

Dr D, what I am getting is 418 out of 1000 that can't be a sum of consecutive odd numbers , by rather tedious means. I was hoping for a more elegant solution too. Let me think on this more to see which one of us is right.

Dr D, this is really lovely, great answer you have here. I would already pick you as BA, but I'd like to leave it out open for a bit longer.

It seems like an interesting alternate way of defining prime numbers, namely that it's those numbers that cannot be expressed by any odd number of consecutive odd numbers.

Eh, scratch the last comment, I'm boozed up right now, but I find this connection between prime numbers and sums of consecutive odd numbers intriguing.

### 2 Answers

- Dr DLv 71 decade agoFavorite Answer
The sum of n odd consecutive numbers is

(2k + 1) + (2k + 3) + ... + (2k + 2n - 1)

= n * (2k + n)

k = 0, 1, 2, .....

This means that if n is even, then any multiple of 2n starting from n^2 can be expressed as the sum of consecutive odds.

If n is odd, then any odd multiple of n starting from n^2 can be.

n ≤ 10 since the first 10 odd numbers sum to 100

So n = 2, 3, ... , 9, 10

For n = 2: any multiple of 4

That's 25 numbers.

For n = 3: any odd multiple of 3 starting from 3^2

That's 16 of them.

For n = 4: any multiple of 8 starting from 4^2 (already counted)

For n = 5: any odd multiple of 5 starting from 25

There are 8 of them (but 45 and 75 are already counted under n = 3).

ie 6 new numbers

n = 6: any multiple of 12 starting from 36

(already counted under n = 4)

n = 7: any odd multiple of 7 starting from 49

(4 of them but 63 already counted).

n = 8: any multiple of 16 starting from 8^2

(already counted)

n = 9: any odd multiple of 9 starting from 81

(already counted)

That's a total of 50 which can be expressed as the sum of n consecutive odds.

So 50 cannot.

*EDIT*

Well you can go on to show that you only need to count for prime values of n. That is because the numbers for any composite n already gets counted when any one of its factors are considered.

So we count for all prime values of n up to 31. Then subtract the overlaps. Unless I made some error, I'm getting 531 numbers between 1 and 1000 that CAN be summed accordingle i.e. 469 cannot.

It gets a little tedious counting the overlaps. I'm guessing that there is a more elegant solution. I wonder if there is even a geometric solution to this.

*EDIT*

OK OK. I think I have the elegant solution. The numbers which cannot be expressed as the sum of n (>1) consecutive odd numbers are

1) 1

2) even numbers not divisible by 4

3) odd prime numbers

If n is odd, then the sum is equal to the product of the middle number and n. i.e. it is an odd composite.

If n is even, then the sum is the product of n and the even number between the two middle numbers.

For 1 - 100, this works out to be 50.

And for 1 - 1000, it does work out to be 418 (http://en.wikipedia.org/wiki/List_of_prime_numbers )

I miscounted somewhere earlier.

For 1 to 10,000 this works out to be 1228 odd primes (http://www.mathsisfun.com/numbers/prime-numbers-to... )+ 1 + 2500 (evens not div by 4)

= 3729

The only thing that remains to be tested is if there are any odd composites that are exceptions to this rule. Any odd composite can be written as the product of two odd numbers, p and q. Either p = q or p > q.

If p = q, then the sequence can be written as p consecutive odds starting from 1 with p as the middle digit.

e.g. 25 = 1+3+5+7+9

If p > q, then you have q odds with p as the middle digit. If you go with p odds with q as the middle digit you end up with negative odds at the beginning.

e.g. 15 = 3+5+7 = -1+1+3+5+7

Bottom line: you can always express odd composites as a sequence of consecutive positive odds. So the final criteria:

The numbers which cannot be expressed as the sum of n (>1) consecutive odd numbers are

1) 1

2) even numbers not divisible by 4

3) odd prime numbers

- Mike1942fLv 71 decade ago
1 in all cases

2 and 3 in the case of n=2

all of the numbers less than n*2

all of the odd numbers if n is even

all of the even numbers if n is odd