12 Replies - 374 Views - Last Post: 04 November 2017 - 11:43 AM Rate Topic: -----

#1 andriasss  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13483
  • View blog
  • Posts: 53,820
  • 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?
Was This Post Helpful? 0
  • +
  • -

#3 andriasss  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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?
Was This Post Helpful? 0
  • +
  • -

#4 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1375
  • View blog
  • Posts: 4,309
  • 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


https://en.wikipedia.../wiki/Quadratic

Pick one of the terms used here....
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5886
  • View blog
  • Posts: 20,094
  • Joined: 05-May 12

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

Posted 03 November 2017 - 01:18 PM

Quadratic sequence

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.)
Was This Post Helpful? 1
  • +
  • -

#6 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1375
  • View blog
  • Posts: 4,309
  • Joined: 20-March 10

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

Posted 03 November 2017 - 01:23 PM

Oh thanks for that... still quadratic equations yes quadratic variance yes...

but I had never heard the term quadratic sequence you live and learn I suppose... ;)
Was This Post Helpful? 0
  • +
  • -

#7 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1375
  • View blog
  • Posts: 4,309
  • 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

Was This Post Helpful? 0
  • +
  • -

#8 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5886
  • View blog
  • Posts: 20,094
  • 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.
Was This Post Helpful? 0
  • +
  • -

#9 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1375
  • View blog
  • Posts: 4,309
  • 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...
Was This Post Helpful? 0
  • +
  • -

#10 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5886
  • View blog
  • Posts: 20,094
  • 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.
Was This Post Helpful? 0
  • +
  • -

#11 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1375
  • View blog
  • Posts: 4,309
  • 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,...
Was This Post Helpful? 0
  • +
  • -

#12 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1375
  • View blog
  • Posts: 4,309
  • 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....

Posted Image

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

summing all n terms up...
Was This Post Helpful? 1
  • +
  • -

#13 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 5886
  • View blog
  • Posts: 20,094
  • 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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1