• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need help finding a pattern in a sequence.

PowerMacG5

Diamond Member
I have written an algorithm, to do a certain task, but I need help finding a pattern to this sequence of number I have gotten.

The sequence is as follows: 2,2,6,10,22,42,86,170,342,682.

Does anyone know a pattern to this? It is fine if the pattern is a recursive one.
 
Originally posted by: UnbannableTroll
ummmm....wtf? I'm borderline retarded and figured this one out.

Instead of being a troll as your name suggests, why not post the solution and help me.
 
Originally posted by: Marauder911
Originally posted by: UnbannableTroll
ummmm....wtf? I'm borderline retarded and figured this one out.

Instead of being a troll as your name suggests, why not post the solution and help me.

Actually it wouldn't help you. A common problem among engineers is they don't recognize the obvious/ simplest solution.
 
Originally posted by: UnbannableTroll
Originally posted by: Marauder911
Originally posted by: UnbannableTroll
ummmm....wtf? I'm borderline retarded and figured this one out.

Instead of being a troll as your name suggests, why not post the solution and help me.

Actually it wouldn't help you. A common problem among engineers is they don't recognize the obvious/ simplest solution.

Translation: I don't really know, I just feel like being a dick.
 
Just by quick examination to me it looks like:

sequence: x1,x2,x3,...,x10

where x(i)=[2*x(i-1)]-2 for all even i
and x(i)=[2*x(i-1)]+2 for all odd i

or x(i)=[2*x(i-1)]-[2*(-1)^(i)]

Hope this helps, if not, then I say 42
 
Originally posted by: Ophir
Just by quick examination to me it looks like:

sequence: x1,x2,x3,...,x10

where x(i)=[2*x(i-1)]-2 for all even i
and x(i)=[2*x(i-1)]+2 for all odd i

or x(i)=[2*x(i-1)]-[2*(-1)^(i)]

Hope this helps, if not, then I say 42

youre close... click my linky above 😛
 
Originally posted by: Zugzwang152
linky


Scroll down to the second post. If you add a 1 then 0 as 1st and 2nd terms, your series is defined as 2 ^ (n - 1) according to this.

Originally posted by: Ophir
Just by quick examination to me it looks like:

sequence: x1,x2,x3,...,x10

where x(i)=[2*x(i-1)]-2 for all even i
and x(i)=[2*x(i-1)]+2 for all odd i

or x(i)=[2*x(i-1)]-[2*(-1)^(i)]

Hope this helps, if not, then I say 42

Thank you both for the help. This definitely helps, but the only problem is I do not know n is even or odd, but since this is an Algorithm Analysis class, the O notation of both algorithms is the same; so this definitely helps. Once again, I thank you for your help.
 
Originally posted by: Jeff7181
Originally posted by: UnbannableTroll
Originally posted by: Marauder911
Originally posted by: UnbannableTroll
ummmm....wtf? I'm borderline retarded and figured this one out.

Instead of being a troll as your name suggests, why not post the solution and help me.

Actually it wouldn't help you. A common problem among engineers is they don't recognize the obvious/ simplest solution.

Translation: I don't really know, I just feel like being a dick.

The correct translation is "do your own homework" with an underlying meaning of "I hate having to redesign sh!t engineers put way too much thought into".
 
Originally posted by: UnbannableTroll
Originally posted by: Jeff7181
Originally posted by: UnbannableTroll
Originally posted by: Marauder911
Originally posted by: UnbannableTroll
ummmm....wtf? I'm borderline retarded and figured this one out.

Instead of being a troll as your name suggests, why not post the solution and help me.

Actually it wouldn't help you. A common problem among engineers is they don't recognize the obvious/ simplest solution.

Translation: I don't really know, I just feel like being a dick.

The correct translation is "do your own homework" with an underlying meaning of "I hate having to redesign sh!t engineers put way too much thought into".

Dude, shut the fvck up. You had nothing constructive to say, and I am doing my own homework, I just could not see a pattern in a series of numbers. If you only knew what this was going in to, you would shut up since this is a tiny part of a project I have been working on for weeks. I will not post a link to the project, because then it would simply be feeding you troll.

Once again, thanks to every one who helped.
 
Originally posted by: Marauder911
Originally posted by: UnbannableTroll
Originally posted by: Jeff7181
Originally posted by: UnbannableTroll
Originally posted by: Marauder911
Originally posted by: UnbannableTroll
ummmm....wtf? I'm borderline retarded and figured this one out.

Instead of being a troll as your name suggests, why not post the solution and help me.

Actually it wouldn't help you. A common problem among engineers is they don't recognize the obvious/ simplest solution.

Translation: I don't really know, I just feel like being a dick.

The correct translation is "do your own homework" with an underlying meaning of "I hate having to redesign sh!t engineers put way too much thought into".

Dude, shut the fvck up. You had nothing constructive to say, and I am doing my own homework, I just could not see a pattern in a series of numbers. If you only knew what this was going in to, you would shut up since this is a tiny part of a project I have been working on for weeks. I will not post a link to the project, because then it would simply be feeding you troll.

Once again, thanks to every one who helped.

Say what you want. Was it simple? I wasn't trying to be a dick. Just trying to get you to look at the problem again without ATOT giving you the answer.
 
I don't know if you got it yet or not so I'll just post. Say that was in an array called numbers. Let the current position = x. To get the value of numbers[x+1], multiply numbers[x-1] by 2 and add it to [x].

numbers[x+1] = numbers[x] + 2*numbers[x-1],

Edit I think I'm wrong but I don't really care.
 
I just added 2 + 2 and added another 2 on the odd lines.
2+2+(+2)=6
2+2+6=10
2+2+6+10(+2)=22
2+2+6+10+22=42
2+2+6+10+22+42(+2)=86
2+2+6+10+22+42+86=170
2+2+6+10+22+42+86+170(+2)=342
2+2+6+10+22+42+86+170+342=682
2+2+6+10+22+42+86+170+342+682(+2)=1366
 
Originally posted by: KK
I just added 2 + 2 and added another 2 on the odd lines.
2+2+(+2)=6
2+2+6=10
2+2+6+10(+2)=22
2+2+6+10+22=42
2+2+6+10+22+42(+2)=86
2+2+6+10+22+42+86=170
2+2+6+10+22+42+86+170(+2)=342
2+2+6+10+22+42+86+170+342=682
2+2+6+10+22+42+86+170+342+682(+2)=1366



Exactly...KISS....then write the equations

and to quote his sig:

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction.
- Albert Einstein. "
 
Back
Top