OFFSET
0,3
COMMENTS
For n > 2, periodic with period 7: repeat [1, 1, 1, 1, 0, 1, 1].
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 1).
FORMULA
G.f.: x*(3*x^8 - x^5 - x^4 - x^3 - x^2 - 4*x - 1)/(x^7 - 1). - Chai Wah Wu, Jun 04 2016
a(n) = sign(n mod 7) for n > 2. - Wesley Ivan Hurt, Dec 23 2016
MAPLE
A185058:= n -> [0, 1, 1, 1, 1, 1, 1][(n mod 7)+1]: 0, 1, 4, seq(A185058(n), n=3..100); # Wesley Ivan Hurt, Dec 23 2016
MATHEMATICA
Table[PowerMod[n, n!, 7], {n, 0, 84}]
Join[{0, 1, 4}, LinearRecurrence[{0, 0, 0, 0, 0, 0, 1}, {1, 1, 1, 1, 0, 1, 1}, 82]] (* Ray Chandler, Aug 26 2015 *)
PadRight[{0, 1, 4}, 120, {0, 1, 1, 1, 1, 1, 1}] (* Harvey P. Dale, May 29 2020 *)
PROG
(Magma) [0, 1, 4] cat &cat [[1, 1, 1, 1, 0, 1, 1]^^20]; // Wesley Ivan Hurt, Dec 23 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
José María Grau Ribas, Jan 21 2012
STATUS
approved