OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 1).
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
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 13 2002
STATUS
approved