Nice little puzzle!!!
Wow nice work Saul!
6, 28 and 496 are known as “perfect numbers,” defined as numbers that equal the sum of all of their factors, excluding the number itself.
So, as you noted, 6 = 1+2+3, which happen to be the factors of 6 excluding 6 itself.
Likewise, 28 = 1+2+4+7+14, and 496 = 1+2+4+8+16+31+62+124+248-- in each case, the sum of all factors excluding the number itself.
I know this is not what you said, but the reason I am so impressed by your answer is that you discovered a very cool thing on your own, which is that there is a deep connection between perfect numbers and Mersenne primes – which are prime numbers of the form 2^n -1 (2 to the nth power minus 1).
So, 3 is 2^2 -1, 7 is 2^3-1, and 31 is 2^5-1 – each is a Mersenne prime, and each thus is associated with a perfect number!
How?
Exactly as you specified – the sum of the integers leading up to a Mersenne prime yields a perfect number. I am absolutely astonished (and, I admit, even a bit impressed!) that you came up with this on your own just noodling around – it is a fairly deep concept of number theory.
The connection between Mersenne primes and perfect numbers is usually expressed somewhat differently (as the Mersenne prime 2^n -1 multiplied by 2^(n-1) – e.g. if n is 5, the prime is 2^n-1 = 31 and the multiplier is 2^(5-1) =2^4 = 16),
see http://www.millersville.edu/~bikenaga/number-theory/perfect/…
but it is easy to show that 2^(n-1) equals the sum of the numbers from 1 to 2^n - 1 – matching your approach above. (The proof is pretty simple – use Gauss’s trick to add all the integers from 1 to 2^n-1 – i.e., it equals the number you are adding up to (2^n-1) times the next higher integer (2^n) divided by 2. (For example the sum of the numbers from 1 to 10 equals 10*11/2 = 55.) When you divide the 2 into the 2^n factor, you get 2^(n-1), showing the equivalence between your sum and the more common formulation.
Anyway, I bored the tears off of everyone with this post, but a very sincere well done to you, Saul
Rich
Chance Elder Dancer and A Drumlin Daisy (depending on which MF service I logged into).