login
A070641
a(n) = n^6 mod 18.
0
0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1, 0, 1, 10, 9, 10, 1
OFFSET
0,3
FORMULA
From Wesley Ivan Hurt, Dec 26 2023: (Start)
a(n) = (31+9*(-1)^n-36*cos(n*Pi/3)-4*cos(2*n*Pi/3))/6.
G.f.: x*(1+10*x+9*x^2+10*x^3+x^4)/(1-x^6).
a(n) = a(n-6). (End)
MATHEMATICA
PowerMod[Range[0, 120], 6, 18] (* or *) PadRight[{}, 120, {0, 1, 10, 9, 10, 1}] (* Harvey P. Dale, Jan 08 2019 *)
PROG
(Sage) [power_mod(n, 6, 18)for n in range(0, 90)] # Zerinvary Lajos, Nov 06 2009
(PARI) a(n)=n^6%18 \\ Charles R Greathouse IV, Apr 06 2016
CROSSREFS
Sequence in context: A164732 A070562 A216557 * A231471 A063661 A154533
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 13 2002
STATUS
approved