Info

This question is closed. Reopen it to edit or answer.

How could i make a Hexnacchi sequence in matlab?

1 view (last 30 days)
I have a big problem, i need to make a program for Hexnacchi sequence ( 1, 1, 2, 4, 8, 16, 32, 63, 125 is a case of the sequence)does anybody know how?

Answers (1)

Image Analyst
Image Analyst on 11 Apr 2013
Is this a homework exercise? I don't mean to ask the obvious, but since you didn't mention it, did you try a for loop? Or try the sum() function?
  2 Comments
Stefan
Stefan on 11 Apr 2013
yes it is and i'm having real problems with it i should do it with a loop but i cant figure out how
Image Analyst
Image Analyst on 12 Apr 2013
Edited: Image Analyst on 12 Apr 2013
Then you should have marked it as homework. I'll do it for you.
See what you can do with this massive hint:
Hexnacchi(1) = 1;
for k = 2 : 10
index2 = k-1
index1 = max(k-6, 1)
Hexnacchi(k) = .....
end
Another hint: it involves the sum() function.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!