75.4k views
2 votes
Fred and Frank play a game. Fred picks an even number X and asks Frank to add all even numbers between 0 and X (inclusive) as fast as possible. After some rounds Frank found a quick way to do it. He simply multiplies X/2 by (X/2 + 1). Explain why it always works.

User LaBUBU
by
5.0k points

1 Answer

4 votes

Answer:

The even numbers between 0 and X represents an arithmetic sequence with a common difference of 2

The rule of arithmetic sequence = a + d(n - 1)

Where a is the first term and n is the number of terms

So, for the even numbers between 0 and X

The first term = a = 0

d = 2

So, we need to find n at the last term which is X

∴ X = 0 + 2 ( n -1 )

∴ n - 1 = X/2

∴ n = X/2 + 1

The sum of the arithmetic sequence = (n/2) × (2a + (n−1)d)

Substitute with a and d and X

So, the sum = (n/2) * (2*0 + (n−1)*2)

= (n/2) * ((n−1)*2)

= n(n-1)

= (X/2 + 1) * (X/2)

= X/2 by (X/2 + 1)

So, The quick way to add all even numbers between 0 and X always works.

User Soorajlal K G
by
5.0k points