# Is anyone here? I need help to calculate quadratic sequence

Page 1 of 1

## 12 Replies - 410 Views - Last Post: 04 November 2017 - 11:43 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=407372&amp;s=1cb07e3e543b379faf5f4cb07c1fe8db&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 andriasss

Reputation: 0
• Posts: 2
• Joined: 03-November 17

# Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 11:10 AM

I dont know how to calculate first n term summary when we have quadratic sequence

exm.c1- 1 1 2 8 64 ....
b1 1 2 4 8 16
q 2 2 2 2
Is This A Good Question/Topic? 0

## Replies To: Is anyone here? I need help to calculate quadratic sequence

### #2 modi123_1

• Suitor #2

Reputation: 13859
• Posts: 55,340
• Joined: 12-June 08

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 11:10 AM

Yes people are here.

What have you tried?

### #3 andriasss

Reputation: 0
• Posts: 2
• Joined: 03-November 17

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 11:14 AM

I tried to use for loop but teacher said i have to find out first n term sum formula it helps program to work more fast. But i dont know how to find in internet because of my bad english

Do you know whats the name of this sequence?

### #4 snoopy11

• Engineering ● Software

Reputation: 1438
• Posts: 4,630
• Joined: 20-March 10

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 12:52 PM

I have no idea what you are talking about you must give us exactly the terms used by your teacher word for word

There is no such thing as a Quadratic sequence

Pick one of the terms used here....

### #5 Skydiver

• Code herder

Reputation: 6067
• Posts: 20,892
• Joined: 05-May 12

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 01:18 PM

There is also a stack overflow answer that gives the formula for the sum of the the first n terms of a quadratic sequence.

That is the first time I have heard of a quadratic sequence. Must be a relatively new thing because even my math and calculus teachers who love to teach us all kinds of esoteric stuff never covered this.

On the other hand, suddenly that sequence (3, 8, 15, 24) looks familiar. I saw that sequence in an interview question which asked me to provide the next number in the series. I burned half an hour on that question. (I skipped ahead to the other questions and came back to this one to use up the rest of the hour.)

### #6 snoopy11

• Engineering ● Software

Reputation: 1438
• Posts: 4,630
• Joined: 20-March 10

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 01:23 PM

but I had never heard the term quadratic sequence you live and learn I suppose...

### #7 snoopy11

• Engineering ● Software

Reputation: 1438
• Posts: 4,630
• Joined: 20-March 10

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 03 November 2017 - 01:34 PM

Anyway according to the bbc page you posted the equation the OP is looking for is this

Equation: an2 + b

This post has been edited by snoopy11: 03 November 2017 - 01:34 PM

### #8 Skydiver

• Code herder

Reputation: 6067
• Posts: 20,892
• Joined: 05-May 12

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 04 November 2017 - 08:11 AM

That finds the n-th term. The OP is seeking to find the sum up to the n-term without using iterative approaches according to post #3.

### #9 snoopy11

• Engineering ● Software

Reputation: 1438
• Posts: 4,630
• Joined: 20-March 10

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 04 November 2017 - 08:15 AM

Oh I see so the sum of all the nth terms then.... worse.. poor OP what a question...

### #10 Skydiver

• Code herder

Reputation: 6067
• Posts: 20,892
• Joined: 05-May 12

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 04 November 2017 - 08:23 AM

As I mentioned, there is a proposed solution in StackOverflow. From what I recall, the solution proposed there only deals with the case when a = 1, and b = 0, but I didn't look too closely. What was nice was that it walked through the derivation of the equation, so the same analysis could be performed for other values of a and b if one is patient and not looking for a gimme-the-codez.

### #11 snoopy11

• Engineering ● Software

Reputation: 1438
• Posts: 4,630
• Joined: 20-March 10

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 04 November 2017 - 08:33 AM

Well it should be possible to sum the terms up.. for all a n and b rather than just a specific case I will think on it...

Research is always the key to these kind of problems,...

### #12 snoopy11

• Engineering ● Software

Reputation: 1438
• Posts: 4,630
• Joined: 20-March 10

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 04 November 2017 - 09:05 AM

I found the general equation for the form an2

it is this....

in code this means a sum variable and a loop variable from 1 to a2.....

summing all n terms up...

### #13 Skydiver

• Code herder

Reputation: 6067
• Posts: 20,892
• Joined: 05-May 12

## Re: Is anyone here? I need help to calculate quadratic sequence

Posted 04 November 2017 - 11:43 AM

+1. And the constant part is easy.