English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Question 1

It took Tom ten seconds to sum the integers from 1 to 100. Now it's your turn. find a fast way to sum the integers from 1 to 100; from 1 to n.

Thank you for your help.

2007-08-19 12:16:28 · 1 answers · asked by gfrog82 4 in Education & Reference Homework Help

1 answers

Consider 100 + 1, then 99 + 2, 98 + 3, and so on. That's 101 fifty times. 101 * 50 = 5050.

In general, if n is even, then consider n + 1. Multiply (n + 1) by n/2

If n is odd, then consider n + 1. Multiply (n + 1) by (n - 1)/2. Then add (n + 1)/2.

2007-08-19 12:23:29 · answer #1 · answered by SoulDawg 4 UGA 6 · 1 0

fedest.com, questions and answers