login
Digital root of n!.
3

%I #28 Jan 26 2023 21:21:46

%S 1,1,2,6,6,3,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,

%T 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,

%U 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9

%N Digital root of n!.

%C a(n) = 9 for n >= 6.

%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).

%F a(n) = A010888(n!) = fixed-point of A007953(n!). It equals n! modulo(9); at r = 0 use 9.

%F G.f.: (1 + x^2 + 4*x^3 - 3*x^5 + 6*x^6)/(1 - x). - _Stefano Spezia_, Jan 26 2023

%e n = 5, 5 != 120, iteration list = {120,3}, a(5) = 3.

%t sud[x_] := Apply[Plus, DeleteCases[IntegerDigits[x], 0]]; Table[FixedPoint[sud, w!], {w, 1, 87}]

%Y Cf. A000142, A086353-A086361, A007953, A010888, A038194, A029898, A004152.

%K nonn,base,easy

%O 0,3

%A _Labos Elemer_, Jul 21 2003

%E a(0) = 1 prepended by _Alois P. Heinz_, Dec 05 2018