1. [SOLVED] Cool Sequence

Let us call a sum of integers cool if the first and last terms are 1 and each term differs from its neighbours by at most 1. For example, the sum 1+2+3+4+3+2+3+3+3+2+3+3+2+1 is cool. How many terms does it take to write 2008 as a cool sum if we use no more terms than necessary?

I found there are 89 terms needed. Maybe there is another that lesser?

Thx

2. 1004 + 1004

669 + 670 + 669

3. Originally Posted by Wilmer
1004 + 1004

669 + 670 + 669
the first and last terms need to be 1

4. Ahhh....thanks.

89 I'm sure is correct: 2(sum 1 to 44) + 28

1+2+3....+27+28+28+29....+43+44+44+43....+3+2+1

A formula to find could be as a general case:
(n = number of terms, x = number represented):
n(n+1) = x
n^2 + n - x = 0
n = INT[SQRT(4x + 1) - 1]

n = INT[SQRT(4*2008 + 1) = 88
Add 1 if n(n + 2) / 4 < x

5. Originally Posted by Wilmer
n = INT[SQRT(4x + 1) - 1]

n = INT[SQRT(4*2008 + 1) = 88
Add 1 if n(n + 2) / 4 < x
Sorry, i don't get this part..

thx

6. Hello, songoku!

A fascinating problem . . .

Let us call a sum of integers cool if the first and last terms are 1
. . and each term differs from its neighbours by at most 1.
For example, the sum $1+2+3+4+3+2+3+3+3+2+3+3+2+1$ is cool.

How many terms does it take to write 2008 as a cool sum
. . if we use no more terms than necessary?

I found there are 89 terms needed. Maybe there is another that's lesser?
I believe that 89 terms is the minimum, but I have no proof.

The "fastest" way to total 2008 seems to be consecutive integers:
. . $\bigg(1 + 2 + 3 + \hdots + 44\bigg) + 45 + \bigg(44 + 43 + 42 + \hdots + 1\bigg) \;=\;2025$

The sum is slightly large.

I can remove 17 from the sum and maintain its coolness:

. . $\bigg(1+2+ \hdots + 40\bigg) + 40 + \underbrace{\bigg(41 + 41 + \hdots + 41\bigg)}_{\text{8 terms}} + \bigg(40 + 39 + \hdots + 1\bigg) \;=\; 2008$

. . but I cannot reduce the number of terms.

7. Originally Posted by songoku
Sorry, i don't get this part..
> n = INT[SQRT(4*2008 + 1) = 88
> Add 1 if n(n + 2) / 4 < x

88(90)/4 = 1980 ; lesser than 2008, so need another term;
in some cases, n(n + 2) / 4 will equal x, then no need for extra term.

8. Originally Posted by Soroban
I can remove 17 from the sum and maintain its coolness
No; then you'll have ...16,18: difference > 1

9. Originally Posted by Wilmer
n = INT[SQRT(4*2008 + 1) = 88
Now i get it that you used quadratic formula. I think you miss the term -1 here. And what is INT? I guess it's rounding down?

Originally Posted by Wilmer
No; then you'll have ...16,18: difference > 1
I think Soroban doesn't mean to take the term "17" out. Instead, he means that he can take out the terms that sum up to 17 because 2025 - 2008 = 17

10. I know this question. It's from the Australian Mathematics Competition, I know because I have it right here in front of me

Here's how I did it.
First you have to find up to what number you add will get you closet to 2008 (sorry if this doesn't make sense just keep reading).

I guess 40. (so 1+2+3.....+40+40+39....+1)
Use this formula:
$\frac {n(n+1)}{2}$
Where n is 40. Substitute the values in then multiply by 2. Now you just figured out what 1+2+3.....+40+40+39....+1 is. It is 1640. Is it near 2008? No?

Now guess another one. I guessed 44. Substitute again and wa la we get 1980. Since that is the closest we can get to 2008 just subtract 1980 from 2008. The answer is 28.

So how many terms? We have 1....44 then 44...1 that's 88 then add the last 28 which makes 89!!!

11. Looks like you guys don't follow what I've "tried" to show.

I'm also using that formula, jgv; but no guessing; we want the series
to add to half the number, or to 2008/2 = 1004:
n(n+1) / 2 = 1004
n^2 + n = 2008
n^2 + n - 2008 = 0
n = [-1 + sqrt(1 + 8032)] / 2
n = 44.3135024....
So n = FLOOR(n) = 44 ; I used n = INT(n) ... same thing

To wrap up, since that's for half the number, then n = 2n = 88;
since n <> FLOOR(n), add 1: n = 2n + 1 = 89

So a GENERAL CASE formula is (let the given number 2008 = x):
n(n+1) / 2 = x / 2
n^2 + n = x
n^2 + n - x = 0
n = [-1 + SQRT(1 + 4x)] / 2

IF FLOOR(n) = n
then
n= 2[FLOOR(n)]
else
n = 2[FLOOR(n)] + 1

12. Thx a lot Wilmer, jgv115, and Soroban ^^