OFFSET
0,4
LINKS
Robert Israel, Table of n, a(n) for n = 0..4763
Index entries for linear recurrences with constant coefficients, signature (0,0,1,0,0,18,0,0,-18,0,0,-1,0,0,1).
FORMULA
EXAMPLE
a(3) = 2^3 mod 5 = 3.
MAPLE
f:= proc(n)
if n mod 6 = 3 then combinat:-fibonacci(n+1)
elif n mod 3 = 2 then 1
else combinat:-fibonacci(n)
fi
end proc:
map(f, [$0..100]);
MATHEMATICA
Table[PowerMod @@ Fibonacci[n + {0, 1, 2}], {n, 0, 50}] (* Amiram Eldar, Dec 22 2021 *)
PROG
(PARI) a(n) = lift(Mod(fibonacci(n), fibonacci(n+2))^fibonacci(n+1)); \\ Michel Marcus, Dec 22 2021
(Python)
from sympy import fibonacci
def A350253(n): return 1 if (m := n % 6) == 2 or m == 5 else (fibonacci(n+1) if m == 3 else fibonacci(n)) # from formula Chai Wah Wu, Dec 22 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
J. M. Bergot and Robert Israel, Dec 21 2021
STATUS
approved