login
A189510
Digital root of n^n.
3
1, 1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7, 9, 7, 8, 9, 1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7, 9, 7, 8, 9, 1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7, 9, 7, 8, 9, 1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7, 9, 7, 8, 9, 1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7
OFFSET
0,3
COMMENTS
a(n) = A010888(A000312(n)).
For n >= 1, this sequence is periodic with period 18. The sequence repeats [1,4,9,4,2,9,7,1,9,1,5,9,4,7,9,7,8,9]. - Nathaniel Johnston, May 04 2011
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
FORMULA
From Chai Wah Wu, Feb 09 2023: (Start)
a(n) = a(n-18) for n > 18.
G.f.: (-8*x^18 - 8*x^17 - 7*x^16 - 9*x^15 - 7*x^14 - 4*x^13 - 9*x^12 - 5*x^11 - x^10 - 9*x^9 - x^8 - 7*x^7 - 9*x^6 - 2*x^5 - 4*x^4 - 9*x^3 - 4*x^2 - x - 1)/(x^18 - 1). (End)
MAPLE
A189510 := proc(n) return ((n^n-1) mod 9) + 1: end: seq(A189510(n), n=0..80); # Nathaniel Johnston, May 04 2011
MATHEMATICA
digitalRoot[n_Integer?Positive] := FixedPoint[Plus@@IntegerDigits[#]&, n]; Table[If[n==0, 0, digitalRoot[n^n]], {n, 0, 200}]
Join[{1}, LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7, 9, 7, 8, 9}, 86]] (* Ray Chandler, Aug 27 2015 *)
PROG
(Python)
def A189510(n): return (9, 1, 4, 9, 4, 2, 9, 7, 1, 9, 1, 5, 9, 4, 7, 9, 7, 8)[n%18] if n else 1 # Chai Wah Wu, Feb 09 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
EXTENSIONS
a(0) corrected by Reinhard Zumkeller, May 03 2011
STATUS
approved