0

Not Yet Answered # Help with a Sequence

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 :)

VernonDozier 2,218 stultuske 1,049 VernonDozier 2,218 Discussion Starter defychaos ~s.o.s~ 2,560 stultuske 1,049

0

0

You already posted this in the C++ forum.

http://www.daniweb.com/forums/thread150233.html

0

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

0

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.

0

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)

0

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.

0

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

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

the function that I created to find the ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

code for the listbox - datagridview interaction

At the top of the code ...

Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.

btn_addline :

`Private Sub btn_addline_Click(ByVal ...`