OFFSET
0,2
COMMENTS
Period 6: repeat [1, 5, 7, 8, 4, 2].
Also the digital root of 5^n. - Cino Hilliard, Dec 31 2004
Digital root of the powers of any number congruent to 5 mod 9. - Alonso del Arte, Jan 26 2014
REFERENCES
Cecil Balmond, Number 9: The Search for the Sigma Code. Munich, New York: Prestel (1998): 203.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1).
FORMULA
From R. J. Mathar, Apr 20 2010: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.
G.f.: ( 1+4*x+2*x^2+2*x^3 ) / ( (1-x)*(1+x)*(x^2-x+1) ). (End)
a(n) = 1/2^n (mod 9), n >= 0. - Wolfdieter Lang, Feb 18 2014
From G. C. Greubel, Mar 05 2016: (Start)
a(n) = a(n-6) for n>5.
E.g.f.: (1/2)*(9*exp(x) - exp(-x) + 2*sqrt(3)*exp(x/2)*sin(sqrt(3)*x/2) - 6*exp(x/2)*cos(sqrt(3)*x/2)). (End)
a(n) = (9 - cos(n*Pi) - 6*cos(n*Pi/3) + 2*sqrt(3)*sin(n*Pi/3))/2. - Wesley Ivan Hurt, Jun 28 2016
a(n) = 2^((-n) mod 6) mod 9. - Joe Slater, Mar 23 2017
MAPLE
MATHEMATICA
PowerMod[5, Range[0, 120], 9] (* Harvey P. Dale, Mar 27 2011 *)
Table[Mod[5^n, 9], {n, 0, 100}] (* G. C. Greubel, Mar 05 2016 *)
PROG
(PARI) a(n)=lift(Mod(5, 9)^n); \\ Charles R Greathouse IV, Sep 24 2015
(Magma) [Modexp(5, n, 9): n in [0..100]]; // Wesley Ivan Hurt, Jun 28 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved