# Thread: summation of a series

1. Member
Join Date
Jun 2014
Location
Dhaka
Posts
5
Rep Power
0

## summation of a series

I have given a series like this..
10+13+16+19+....+50;
now I've to find the summation for this.
I did it like following bt its not correct..
public static void main(String[] args){
int i=0,k=10, sum=0;
k=k+2;
for(i=10;i<=50;i++){
sum=sum+k;
}
System.out.println(" "+sum);
}

2. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
5,114
Rep Power
9

## Re: summation of a series

Well this already looks a bit strange:

Java Code:
```public static void main(String[] args){
int i=0,k=10, sum=0;   // k = 10
k=k+2;  // and then it is increased to 12 ?```

3. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,994
Rep Power
10

## Re: summation of a series

You can also use the increment in your loop. Make it i += 3;

Also, note that each term is simply 3 more than the previous. So the difference of the last and the second term would be
(n + k3) - (n + 3) where k is the number of terms after the first. So the difference is (k-1)3 which is divisible by three.
Since 50 - 13 = 37 is not divisible by 3 your series does not make sense (i.e. 50 is not in the series). With a little thought
you could also derive a general formula for calculating the sum.

Regards,
Jim

4. ## Re: summation of a series

Originally Posted by jim829
Since 50 - 13 = 37 is not divisible by 3 your series does not make sense (i.e. 50 is not in the series).
Strictly speaking, that is not true; just because 50 doesn't fit a reason of induction, only shows that the reasoning doesn't describe the series ... it's the OP's turn to fully describe the series, i.e. 10,13,16 .. 50 doesn't cut it.

kind regards,

Jos (nitpicker ;-)

5. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,994
Rep Power
10

## Re: summation of a series

Well, I did make an assumption.

Student: What's the next value in this series: 1,3,5,7,?
Prof: 129282
Student: What series is that?
Prof: The one that has 129282 following 1,3,5,7.

Regards,
Jim

6. Member
Join Date
Jun 2014
Posts
15
Rep Power
0

## Re: summation of a series

op,
I'm no rocket surgeon, but I have to say I think your series is a little wacky. I thought the series would be:
13 16 19 22 25 28 31 34 37 40 43 46 49 52
but then again I'm not much of a math guy. It looks like you just keep adding three to it, so I'm not seeking what k does, I think you'd only need i for your series. i+=3 in a do...while loop would probably do the trick.

7. Senior Member
Join Date
Jan 2013
Location
Northern Virginia, United States
Posts
5,994
Rep Power
10

## Re: summation of a series

Check out posts #3 and #4 of this thread.

Regards,
Jim

8. Senior Member
Join Date
Apr 2013
Location
Sweden
Posts
272
Rep Power
4

## Re: summation of a series

if you just add 3 to every term, fix your loop as Jim829 said.

Or : 1 + 4 + ... + (3n - 2) = n(3n - 1) / 2

9. ## Re: summation of a series

Originally Posted by superhaNds
if you just add 3 to every term, fix your loop as Jim829 said.

Or : 1 + 4 + ... + (3n - 2) = n(3n - 1) / 2
That still doesn't fit the funny ending of the series (10, 13, 16 ... 49, 50)

kind regards,

Jos

10. Senior Member
Join Date
Apr 2013
Location
Sweden
Posts
272
Rep Power
4

## Re: summation of a series

Originally Posted by JosAH
That still doesn't fit the funny ending of the series (10, 13, 16 ... 49, 50)

kind regards,

Jos
Of course not. That means that they don't add 3 to every term, in which case they can ignore the post.
I don't know what fits that series.

11. ## Re: summation of a series

Originally Posted by superhaNds
Of course not. That means that they don't add 3 to every term, in which case they can ignore the post.
I don't know what fits that series.
I do, but it's ugly: for the (x, y) points (0, 10), (1, 13), (2, 16) ... (13, 49), (14, 50) construct a Lagrange (interpolation) polynomial and voila.

kind regards,

Jos

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•