HP Forums

Full Version: (38G) PENTANACCI NUMBERS (OEIS A124313)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For positive integer input N the programme PENTANACCI returns the Nth Pentanacci Number, see:

http://oeis.org/A124313

The number is returned in Ans in Home view.

The matrix powering programme MPOW can be found here:

http://www.hpmuseum.org/forum/thread-3359.html

PENTANACCI

Ans-4►N:
[[1,1,1,1,1],
[1,0,0,0,0],
[0,1,0,0,0],
[0,0,1,0,0],
[0,0,0,1,0]]►M1:
N:
RUN MPOW:
Ans(1,4):

Or you might prefer this:

Ans-4►N:
MAKEMAT(I==1 OR I-1==J,5,5)►M1:
N:
RUN MPOW:
Ans(1,4):
Reference URL's