OFFSET
1,5
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
MATHEMATICA
a[n_] := For[k = 1, True, k++, If[Divisible[Fibonacci[k, 3], n], Return[ Mod[Fibonacci[k + 1, 3], n]]]];
Array[a, 100] (* Jean-François Alcover, Jul 05 2019 *)
PROG
(PARI) a(n) = my(M=[3, 1; 1, 0]); for(k=1, 12*n/7, if((Mod(M, n)^k)[2, 1]==0, return(lift((Mod(M, n)^k)[1, 1]))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Jul 02 2019
STATUS
approved