login
A185058
a(n) = n^n! mod 7.
1
0, 1, 4, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0
OFFSET
0,3
COMMENTS
For n > 2, periodic with period 7: repeat [1, 1, 1, 1, 0, 1, 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
Sequence in context: A122777 A103524 A110916 * A368474 A369935 A374325
KEYWORD
nonn,easy
AUTHOR
STATUS
approved