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

Sky Diploma 571 chococrack 74 Sky Diploma 571 Sky Diploma 571 Discussion Starter defychaos Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

0

0

Well this is nothing but an arithematic progression.

Well the first element is 3 and the second element is ((3x1)+0)=3 again the next element is ((3x2)+1)=7 and so on.

So you will just need to take in the first element as a ;

Then to get the first element multiply.......

To be apt here is the sequence.

```
int recrusive(int a,int b)
{
int x=(a*b)+(b-1);
return x;
}
```

I guess thats the function .

In main

```
int main()
{
int startval=3;
int total=startval;
for (int y=1;y<=somenumber;y++)
{
total+=recrusive(startval,y)
}
cout<<"Total=="<<total;
}
```

Would print out the sum of the sequence.

EDIT::Hoping that this is what you want.Coz if you knew it already and havin some other prob, I am sorry

0

That code yields:

3, 7 , 11, 15, 19, 23, 27, 31 ...

I think you're on the right track though.

I'm trying to figure this one out too.

0

Well this is nothing but an arithematic progression.

Well the first element is 3 and the second element is ((3x1)+0)=3 again the next element is ((3x2)+1)=7 and so on.

So you will just need to take in the first element as a ;

Then to get the first element multiply.......

To be apt here is the sequence.

`int recrusive(int a,int b) { int x=(a*b)+(b-1); return x; }`

I guess thats the function .

In main

`int main() { int startval=3; int total=startval; for (int y=1;y<=somenumber;y++) { total+=recrusive(startval,y) } cout<<"Total=="<<total; }`

Would print out the sum of the sequence.

EDIT::Hoping that this is what you want.Coz if you knew it already and havin some other prob, I am sorry

Well i just realised that the function that i have written isnt recruisive at all. Sorry.

0

Not only that, I am also unable to figure out what a quadratic recursive sequence is..

0

Thank you for your help. I found an expression, but it utilizes defining the two threes as n(sub)1 = 3 and n(sub)2 = 3 at the beginning of the expression. I'm not sure that's allowed as an answer :) It's quite a brain tickler, I know!

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

Recommended Articles

Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:

```
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click
Dim txtB1 As New TextBox
Dim i
For i = ...
```