Math
posted by charlie .
I have to find the relationship between these sequences, and express a generality. Could you help please.
1 + 3 + 5 + 3 + 1 = 3^2 + 2^2
1 + 3 + 5 + 7 + 9 + 7 + 5+ 3 + 1 = 5^2 + 4^2
1 + 3 + 1 = 2^2 + 1^2
I'm thinking sum of consecutive primes can be expressed in squares? The numbers add up. What's the generality?
Thanks

First of all, did you know that the sum of the first n odd numbers is n^2 ?
e.g.
1+3+5+7+9+11 = 6^2 = 36
So when you look at your sequences, they are actually made up of the addition of the sum of n odd number plus the addition of (n1) odd numbers
notice your second is actually
(1+3+5+7+9) + (1+3+5+7) = 5^2 + 4^2
If you know how to express sigma notation you could do
sigma(2i1) from i=1 to n + sigma(2i1) from 1 to n1 = n^2  (n1)^2 
last line should have said :
sigma(2i1) from i=1 to n + sigma(2i1) from 1 to n1 = n^2 + (n1)^2 
Thanks Reiny,
Yes, I spotted that it dosen't work for any run of primes, but it does up to 9. I'm afraid i don't really follow your explanation!
An answer for dummies maybe?
Charlie 
ok, look at this patters
sum of 1 odd number = 1 = 1^2
sum of 2 odd numbers = 1+3 = 4 = 2^2
sum of 3 odd numbers = 1+3+5 = 9 = 3^2
sum of 4 odd numbers = 1+3+5+7 = 16 = 4^2
...
sum of n odd numbers = 1+3+...+ (2n1) = n^2
( 2n1) is the general expression for an odd number.
this has nothing to do with primes.
Why do you say it works only up to 9, it works for the sum of odd numbers up to any value you want.
e.g.
1+3+5+7+9+11+13+15+17+19 = 10^2 = 100.
They were the first 10 odd numbers.
now look again at your second example of
1+3+5+7+9+7+5+3+1
=1+3+5+7+9 + (1+3+5+7)
= sum of first 5 odd numbers + sum of the first 4 odd numbers
= 5^2 + 4^2