There's a famous (and probably apocryphal) story about the mathematician Carl Friedrich Gauss that goes something like this: Gauss was 9 years old, and sitting in his math class. He was a genius even at this young age, and as such was incredibly bored in his class and would always goof off and get into trouble. One day his teacher wanted to punish him for goofing off, and told him that if he was so smart, why didn't he go sit in the corner and add up all the integers from 1 to 100? Gauss went and sat in the corner, but didn't pick up his pencil. The teacher confronted him, saying “Carl! Why aren't you working? I suppose you've figured it out already, have you?” Gauss responded with “Yes – it's 5,050.” The teacher didn't believe him and spent the next ten minutes or so adding everything up by hand, only to find that Gauss was right! So how did Gauss find the answer so fast? What did he see that his teacher didn't? The answer is simple, really – it's all about pattern... read more