Hi :) I'm doing a programming project with development of an algorithm for a quadratic recursive sequence: (3, 3, 7, 11, 19, 20, 32), but I can't figure out which expression to use. I know it's probably got something to do with the differences of n-1 and n-2 being added together. Any help you can offer would be appreciated. Thank you :)

Hi :) I'm doing a programming project with development of an algorithm for a quadratic recursive sequence: (3, 3, 7, 11, 19, 20, 32), but I can't figure out which expression to use. I know it's probably got something to do with the differences of n-1 and n-2 being added together. Any help you can offer would be appreciated. Thank you :)

You already posted this in the C++ forum.
http://www.daniweb.com/forums/thread150233.html

Hi :) I'm doing a programming project with development of an algorithm for a quadratic recursive sequence: (3, 3, 7, 11, 19, 20, 32), but I can't figure out which expression to use. I know it's probably got something to do with the differences of n-1 and n-2 being added together. Any help you can offer would be appreciated. Thank you :)

first of all ... how is this supposed to be a Java related question?
secondly: it took me about three seconds to see the sequence in there.

(3 + 3) + 1 = 7
(3 + 7) + 1 = 11
(7 + 11)+1 = 19
...

if you can't figure out how to recognize such relations in a simple sequence, you may ask yourself whether or not programming is the right option for you

first of all ... how is this supposed to be a Java related question?
secondly: it took me about three seconds to see the sequence in there.

(3 + 3) + 1 = 7
(3 + 7) + 1 = 11
(7 + 11)+1 = 19
...

if you can't figure out how to recognize such relations in a simple sequence, you may ask yourself whether or not programming is the right option for you

Care to expand to the next few elements in the sequence? Perhaps I don't understand your proposed solution, but I get:

(11 + 19) + 1 = 31 for the next element, which does not equal 20.

I can honestly say that's an extremely rude answer, and I'd prefer you rather not input if you're going to respond in that manner. The PROBLEM that I am having is writing the expression, not determining what the actual pattern is. I'm not a total moron. The expression is typically written in a S(sub)n = n(sub)(n-1) + 1, n =1 format, meaning you begin with the number 1. From here, the sequence continues with 1+1, the first one being n(sub)n-1. If you weren't too busy being a rude person, maybe you'd figure out what I was actually asking for isn't so obvious. Chill out and don't help if you don't understand the problem, that's why you ask questions.

It relates to Java, because you can use discrete mathematics to write algorithms in different languages. If you can't see that, maybe programming just isn't for you.

problem: S(sub)n = (3, 3, 7, 11, 19, 31, 51, 83)

He just pointed out that you multi-posted, try not to get personal here.

If the problem here is program logic, post in the Computer Science and Software design forum. If you feel like posting the same question in different language forums, at least post a link to your original thread so that people don't end up discussing the same things over and over again.

Care to expand to the next few elements in the sequence? Perhaps I don't understand your proposed solution, but I get:

(11 + 19) + 1 = 31 for the next element, which does not equal 20.

got me there :)
just looked over it during my break at work, just checked the first numbers

Hi I'm doing a programming project with development of an algorithm for a quadratic recursive sequence: (3, 3, 7, 11, 19, 20, 32), but I can't figure out which expression to use. I know it's probably got something to do with the differences of n-1 and n-2 being added together. Any help you can offer would be appreciated. Thank you

no offence ment, but I see no reference specific to Java in here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.