%I #26 Feb 20 2024 18:38:14
%S 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,
%T 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,
%U 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
%N a(n) = n^3 mod 9.
%C Essentially a duplicate of A021559. - _N. J. A. Sloane_, Oct 30 2009
%C Equivalently: n^(6*m + 3) mod 9. - _G. C. Greubel_, Jun 04 2016
%C Decimal expansion of 2/111. - _Elmo R. Oliveira_, Feb 19 2024
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F G.f.: -x*(1+8*x) / ( (x-1)*(1+x+x^2) ). - _R. J. Mathar_, Aug 24 2016
%t Table[Mod[n^3,9],{n,0,200}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 23 2011 *)
%o (Sage) [power_mod(n,3,9 ) for n in range(0, 105)]
%o (PARI) a(n)=n^3%9 \\ _Charles R Greathouse IV_, Apr 06 2016
%o (PARI) a(n)=[0,1,8][n%3+1]; \\ _Joerg Arndt_, Feb 20 2024
%K nonn,easy
%O 0,3
%A _Zerinvary Lajos_, Oct 29 2009
|