A131954 a(n) = sum of digits of (n! + a(n-1)), with a(1)=1.
1, 3, 9, 6, 9, 18, 18, 18, 36, 36, 45, 36, 36, 54, 54, 72, 72, 63, 54, 63, 72, 81, 108, 90, 81, 90, 117, 99, 144, 126, 144, 117, 153, 153, 153, 180, 162, 117, 198, 207, 153, 198, 198, 234, 216, 225, 234, 243, 234, 225, 207, 288, 297, 279, 297, 351, 279, 306, 333, 297
Offset: 1
Examples
a(4) = Sum_digits(4!+9) = 6.
Links
- Robert Israel, Table of n, a(n) for n = 1..5000
Programs
-
Maple
P:=proc(n) local a,i,k,w; a:=0; for i from 1 by 1 to n do w:=0; k:=a+i!; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=w; print(a); od; end: P(100); # alternative: sd:= n-> convert(convert(n,base,10),`+`): A[1]:= 1: for n from 2 to 100 do A[n]:= sd(n!+A[n-1]) od: seq(A[i],i=1..100); # Robert Israel, Jun 26 2019
-
Mathematica
s={1};Do[AppendTo[s,DigitSum[n!+s[[-1]]]],{n,2,60}];s (* James C. McMahon, Mar 03 2025 *)
Formula
a(n) = Sum_digits(n!+a(n-1)).
Extensions
Offset corrected by Robert Israel, Jun 26 2019
Comments