OFFSET
0,3
COMMENTS
For n > 3, periodic with period 5: repeat [1, 0, 1, 1, 1].
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 1).
FORMULA
a(n) = (2/5)*(2 - cos(2*n*Pi/5) - cos(4*n*Pi/5)) for n > 3. - Wesley Ivan Hurt, Sep 27 2018
MATHEMATICA
Table[PowerMod[n, n!, 5], {n, 0, 84}]
Join[{0, 1, 4, 4}, LinearRecurrence[{0, 0, 0, 0, 1}, {1, 0, 1, 1, 1}, 81]] (* Ray Chandler, Aug 25 2015 *)
PadRight[{0, 1, 4, 4}, 120, {0, 1, 1, 1, 1}] (* Harvey P. Dale, Dec 22 2022 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
José María Grau Ribas, Jan 21 2012
STATUS
approved