OFFSET
1,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..2000
MAPLE
F:= n-> (<<0|1>, <1|1>>^n)[1, 2]:
p:= (M, n, k)-> map(x-> x mod k, `if`(n=0, <<1|0>, <0|1>>,
`if`(n::even, p(M, n/2, k)^2, p(M, n-1, k).M))):
a:= n-> p(<<0|1>, <1|1>>, F(n)$2)[1, 2]:
seq(a(n), n=1..50);
MATHEMATICA
F[n_] := MatrixPower[{{0, 1}, {1, 1}}, n][[1, 2]];
p[M_, n_, k_] := Mod[#, k]& /@ If[n == 0, {{1, 0}, {0, 1}}, If[EvenQ[n], MatrixPower[p[M, n/2, k], 2], p[M, n - 1, k].M]];
a[n_] := p[{{0, 1}, {1, 1}}, F[n], F[n]][[1, 2]];
Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Oct 29 2024, after Alois P. Heinz *)
PROG
(PARI) alist(nn)= my(f=fibonacci); [ f(f(n))%f(n) |n<-[1..nn] ]; \\ Ruud H.G. van Tol, Dec 13 2024
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Oct 09 2015
STATUS
approved