[go: up one dir, main page]

login
A263112
a(n) = F(F(n)) mod n, where F = Fibonacci = A000045.
5
0, 1, 1, 2, 0, 3, 2, 2, 1, 5, 1, 0, 8, 13, 10, 2, 12, 15, 5, 10, 1, 1, 1, 0, 0, 25, 1, 2, 5, 15, 27, 2, 10, 33, 20, 0, 1, 1, 34, 10, 40, 21, 18, 2, 10, 1, 1, 0, 1, 25, 1, 2, 16, 21, 5, 26, 37, 1, 7, 0, 33, 27, 1, 2, 40, 21, 5, 2, 1, 15, 1, 0, 46, 1, 25, 2, 68
OFFSET
1,4
LINKS
FORMULA
a(n) = A007570(n) mod n.
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), n)[1, 2]:
seq(a(n), n=1..80);
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], n][[1, 2]];
Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Oct 29 2024, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A082785 A100949 A152164 * A368818 A110493 A118234
KEYWORD
nonn,look,changed
AUTHOR
Alois P. Heinz, Oct 09 2015
STATUS
approved