A189510 Digital root of n^n.
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
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).
Programs
-
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 *) PadRight[{1},100,{9,1,4,9,4,2,9,7,1,9,1,5,9,4,7,9,7,8}] (* Harvey P. Dale, Jul 31 2025 *)
-
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
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)
Extensions
a(0) corrected by Reinhard Zumkeller, May 03 2011
Comments