Inspired by Brian Charlesworth

Logic Level 3

n = ± 1 ± 2 ± 3 ± ± 99 ± 100 \large n=\pm1\pm2\pm3 \pm \ldots\pm99\pm100

How many distinct integers n n can be written in this form if we may choose either the plus or the minus sign for each term?

Inspiration .


The answer is 5051.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

9 solutions

Otto Bretscher
May 20, 2015

Since the sum involves 50 odd numbers, the result will always be even. Also, the sum will be between 5050 -5050 and 5050 = k = 1 100 k 5050=\sum_{k=1}^{100}k . We claim that, conversely, all even numbers between 5050 -5050 and 5050 5050 (inclusive) are attained, so that there are 5051 5051 such numbers; let's not forget about 0.

We will show that if any number n n other than 5050 -5050 can be written this way, then n 2 n-2 can be written this way as well; counting down from 5050 5050 , in steps of 2 2 , this gives us what we want.

If n n can be written this way, let m m be the smallest number in a chosen representation of n n that comes with the positive sign. If m = 1 m=1 , replace 1 1 by 1 -1 to write n 2 n-2 this way. If m > 1 m>1 , switch the signs of both m m and m 1 m-1 to write n 2 n-2 this way. For example, if n = . . . . 3 + 4.... n=....-3+4.... , then n 2 = . . . . + 3 4... n-2=....+3-4... , with all the other signs remaining the same.

This reminds me of my question ... :D Well done sir!Nice and elegant solution.

Arian Tashakkor - 6 years ago

I confess that I guessed that the converse was true without proving it ... this is a fantastic proof! Nice work!

Bat Dejean - 6 years ago
Chew-Seong Cheong
May 21, 2015

I am seeing the ± \pm before the integer m m as on-off switches. When the m t h m^{th} switch is switched from - (off) to + + (on), n n increases by 2 m 2m . Since the sums of elements in the series { 1 , 2 , 3 , . . . 100 } \{1,2,3,...100\} can represent all integers k k from 1 1 to 5050 5050 . We can switch n n from the minimum 5050 -5050 , when all 100 100 switches are off to the maximum of + 5050 +5050 when all switches are on ( 5050 + 2 × 5050 = + 5050 -5050+2\times 5050 = +5050 ). As the steps are even, n n are all the even integers within ± 5050 \pm 5050 , which are 5051 \boxed{5051} in total.

Richard Polak
May 24, 2015

I think it is helpful to state (for this and similar problems) that we can add any number to n and the number of different combinations doesn't change. That is to say, there are as many values for n as values for m:

m = 1 ± 1 ± 2 ± 3 ± . . . ± 100 m=1\pm1\pm2\pm3\pm...\pm100

This converts to

m = ( 0 or 2 ) ± 2 ± 3 ± . . . ± 100 m=(0\text{ or }2)\pm2\pm3\pm...\pm100 ,

and we can repeat it with every term:

( 0 or 2 ) + ( 0 or 4 ) + ( 0 or 6 ) + . . . + ( 0 or 200 ) (0 \text{ or }2)+(0 \text{ or }4)+(0 \text{ or }6)+...+(0 \text{ or }200)

Hence, (noticing that dividing every term by two doesn't affect the answer) the problem is equivalent to asking, how many distinct integers can be written in the following way?

( 0 or 1 ) + ( 0 or 2 ) + ( 0 or 3 ) + . . . + ( 0 or 100 ) (0\text{ or } 1)+(0\text{ or }2)+(0\text{ or }3)+...+(0\text{ or }100)

With this representation, a variation of Otto's solution leads to say that every number from 0 to 5050 can be represented in this way.

So the answer is 100 101 2 + 1 = 5051 \frac{100\cdot101}{2}+1=\boxed{5051}

Interesting approach... thanks! (+1) I think a proof is still required that any positive integer up to 5050 can be represented as such a sum.

Otto Bretscher - 6 years ago
Michael Biro
May 21, 2015

Here's a proof by induction: We proceed in groups of 4 4 terms. First note that ± 1 ± 2 ± 3 ± 4 ± 7 ± 8 \pm 1 \pm 2 \pm 3 \pm 4\dots \pm 7 \pm 8 can achieve every even number between 36 -36 and 36 36 .

Now, suppose ± 1 ± 2 ± 4 k \pm 1 \pm 2 \dots \pm 4k achieves every even number between ± 2 k ( 4 k + 1 ) \pm 2k(4k+1) . We want to show that including ± ( 4 k + 1 ) ± ( 4 k + 2 ) ± ( 4 k + 3 ) ± ( 4 k + 4 ) \pm (4k+1) \pm (4k+2) \pm (4k+3) \pm (4k+4) will allow us to achieve every even number between ± ( 2 k ( 4 k + 1 ) + 16 k + 10 ) \pm (2k(4k+1) + 16k + 10) .

Now, since ( 4 k + 1 ) ( 4 k + 2 ) ( 4 k + 3 ) + ( 4 k + 4 ) = 0 (4k+1) - (4k+2) - (4k+3) + (4k+4) = 0 , every number achievable before is still achievable. To achieve an even number N N between 2 k ( 4 k + 1 ) 2k(4k+1) and 2 k ( 4 k + 1 ) + 16 k + 10 2k(4k+1) + 16k + 10 , set the first 4 k 4k numbers to achieve N 16 k 10 N - 16k - 10 . This is possible, snce, for k 2 k \geq 2 , we have N 16 k 10 > 2 k ( 4 k + 1 ) 16 k 10 = 8 k 2 14 k 10 > 2 k ( 4 k + 1 ) N - 16k - 10 > 2k(4k+1) - 16k-10 = 8k^2 - 14k - 10 > -2k(4k+1) . Therefore, we can then simply add each of the new numbers to get ( N 16 k 10 ) + ( 16 k + 10 ) = N (N - 16k - 10) + (16k + 10) = N . The negative versions are the same, so the claim holds inductively.

Yes, this works (but you still have to check the case k = 1 k=1 , when you include the numbers 5 , 6 , 7 , 8 5,6,7,8 )

Otto Bretscher - 6 years ago

Log in to reply

Ah, yes, thanks!

Michael Biro - 6 years ago
Rahul Bhat
Aug 19, 2015

The minimum number obtained with all negative signs is -5050. With changing sign of smallest number, sum changes by 2. Similarly, we observe that only even numbers can be obtained from changing signs of numbers alternatively. Therefore total negative numbers obtained = 5050/2 = 2525. Similarly total positive numbers obtained = 2525. We also obtain 0 as one of the sums. Hence total integers = 5051

Vighnesh Raut
May 20, 2015

Let S = 1 + 2 + 3 + . . . . + 100 S=1+2+3+....+100

Now, if we replace any one of the p l u s plus sign, before any number 1 x 100 1\le x\le 100 , then the value of S S reduces by 2 x 2x . Also the minimum value of n n is 5050 -5050 and maximum value of n n is 5050 5050 . So, every even number between 5050 -5050 and 5050 5050 inclusive can be obtained. There are 5051 5051 even numbers within the limit. Hence , the answer is 5051 5051 .

Your answer is correct, but you have not really convinced us that we can write every even number between 5050 -5050 and 5050 5050 this way. For example, how would you write the number 1234 1234 his way, or convince us that it can be done?

Otto Bretscher - 6 years ago

Log in to reply

Consider: q = ± 1 ± 2 ± 3 q=\pm 1\pm 2\pm 3

Convince yourself that q q can take all even values between 6 -6 and 6 6 both inclusive. Also, q q cannot be odd since we have an even number of odd terms in the expression.

Mathematical induction for the win.

Raghav Vaidyanathan - 6 years ago

Log in to reply

I'm still not convinced... I'm a sceptic by nature ;) Can you show us the induction step?

Otto Bretscher - 6 years ago

Log in to reply

@Otto Bretscher That is a bit lengthy. ;) And I understand the skeptic by nature part. Will try to do it when I have time.

Raghav Vaidyanathan - 6 years ago

@Otto Bretscher Ok, I think I got it. We will start with the case of 5050. In this case, if we select one number k k and make it negative, the sum decreases by 2 k 2k . Hence, we can now form all even numbers from 5050 to 4850 by making different numbers negative.

What is we make two numbers negative? Namely 100 100 and another number k k ? Now our sum becomes 4850 2 k 4850-2k since k k can vary between 1 1 and 99 99 , we can now form all even numbers between 5050 5050 and ( 5050 2 100 2 99 ) (5050-2*100-2*99) .

If we make three numbers negative, we can form all even numbers from 5050 5050 to ( 5050 2 100 2 99 2 98 ) (5050-2*100-2*99-2*98) . And so on and so forth. The extreme case is when we take every number to be negative and we end up with 5050 -5050 .

Raghav Vaidyanathan - 6 years ago

My bad. I just assumed that all numbers will be obtained.

Vighnesh Raut - 3 years, 2 months ago
Lu Chee Ket
Nov 15, 2015

Started with computing actually with some technique, it is found that the question becomes finding the total number of terms of an arithmetic progression:

-5050, -5048, - 5046, ..., -3, -1, 1, 3, ..., 5046, 5048, 5050

It is all possible outcomes of n. Tn = 5050 = -5050 + (n - 1) 2 => n = 5051.

-5050 to 5050 is the maximum span of the sum n. Smallest variation is a change between -1 and + 1, next to it is a change between -2 and 2, and finally a change between -5050 and 5050 where every sign change between -1 to -100 and 1 to 100 happened simultaneously. Note that such changes are 2, 4, ..., 10100 and every consequence for a presumed conventional initial of -5050 to turn into any even step addition of A.P. is possible. Therefore we obtained the sequence introduced.

Technique of computing actually arranged 1 to 50 forward and turning back from 51 to 100 to start with. It was noted that:

101, 101, 101 to [101]

99, 97, 95 to 1

-99, -97, -95 to -1

-101, -101, -101 to -101

were happening from (1, 101) to (50, 51) as optional sums of 4^50 of variations.

[11] x 5 + 1 = 56 while [101] x 50 + 1 = 5051.

We can know that 101 x 50 + 1 is the answer!

Answer: 5051

Charlz Charlizard
Jul 27, 2015

For +-1+-2+-3+-4...+-N..The general formula will be.. If (N)(N+1)/2 is even..Tn=(N)(N+1)/2+1 If (N)(N+1)/2 is odd..Tn=(N)(N+1)/2+2 So here (N)(N+1)/2=5050 which is even..so Tn=number of values of n=5051..

Majed Khalaf
May 31, 2015

Here's how I did it: The maximum we can get is 5050 and the minimum is -5050. Since the sum can only be even, there are 5051 numbers with the 0 included.

So it is possible that we have 5051 distinct integers but we must prove it first: Based on the number "5050", we can get any other number less than it, and even of course, for example: 5048=5050-2 (the first term which is 1). 5046=5050-2 (the second term which is 2). . . . 5000=5050-2*(the 25th term which is 25). This can be done with every single term until we reach -5050 which is the minimum value. Note that when you reach the 100th term(100), you will have to start summing up terms(1st and the 100th then 2nd and the 100th). Since it is proved as aforementioned, we have 5051 distinct integers.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...