Page 4 of 4
Posted: Tue Mar 29, 2011 2:58 pm
by CodeX
it means that they would be adding the numbers 1 to 2118 together but whenever the number is a
perfect square it gets added twice so here would be the first few steps:
Code: Select all
n 1 2 3 4 5 6 7 8 9 10 ...
squ y n n y n n n n y n ...
sum 2 3 6 14 19 25 32 40 58 68 ...
where squ is y for square numbers and n if they aren't. 1,4 & 9 are added twice (total += 2*n) because they are 1^2, 2^2 & 3^2 respectively
rabbits everywhere
Posted: Sun Apr 10, 2011 4:42 pm
by bodjo
it is embarrasing to be here again
i think i should work more on my english skills but till that time i will gladely accept any explanation for"the sum of 10th through 17th(rxclusive)
Posted: Sun Apr 10, 2011 5:13 pm
by CodeX
for example: the sum of the 1st through 5th (exclusive) natural numbers is 2+3+4=9 as the first five natural numbers are 1,2,3,4,5. Exclusive means don't include the end points i.e. start < n < end instead of start <= n <= end which would be inclusive
Posted: Sun Apr 10, 2011 5:25 pm
by tompko
It means the sum of the items starting at the 10th and ending at the 17th, including the 10th and 17th items.
So if you have the following sequence:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Then the sum of the 10th through 17th (inclusive) would be 108.