A167176 a(n) = n^3 mod 9.
0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8, 0, 1, 8
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,1).
Programs
-
Mathematica
Table[Mod[n^3,9],{n,0,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 23 2011 *)
-
PARI
a(n)=n^3%9 \\ Charles R Greathouse IV, Apr 06 2016
-
PARI
a(n)=[0,1,8][n%3+1]; \\ Joerg Arndt, Feb 20 2024
-
Sage
[power_mod(n,3,9 ) for n in range(0, 105)]
Formula
G.f.: -x*(1+8*x) / ( (x-1)*(1+x+x^2) ). - R. J. Mathar, Aug 24 2016
Comments