This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A131954 #20 Mar 03 2025 20:27:21 %S A131954 1,3,9,6,9,18,18,18,36,36,45,36,36,54,54,72,72,63,54,63,72,81,108,90, %T A131954 81,90,117,99,144,126,144,117,153,153,153,180,162,117,198,207,153,198, %U A131954 198,234,216,225,234,243,234,225,207,288,297,279,297,351,279,306,333,297 %N A131954 a(n) = sum of digits of (n! + a(n-1)), with a(1)=1. %C A131954 If n >= 5, then 9 divides a(n); see comment in A004152. - _Bernard Schott_, Jun 27 2019 %H A131954 Robert Israel, <a href="/A131954/b131954.txt">Table of n, a(n) for n = 1..5000</a> %F A131954 a(n) = Sum_digits(n!+a(n-1)). %e A131954 a(4) = Sum_digits(4!+9) = 6. %p A131954 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); %p A131954 # alternative: %p A131954 sd:= n-> convert(convert(n,base,10),`+`): %p A131954 A[1]:= 1: %p A131954 for n from 2 to 100 do A[n]:= sd(n!+A[n-1]) od: %p A131954 seq(A[i],i=1..100); # _Robert Israel_, Jun 26 2019 %t A131954 s={1};Do[AppendTo[s,DigitSum[n!+s[[-1]]]],{n,2,60}];s (* _James C. McMahon_, Mar 03 2025 *) %Y A131954 Cf. A004152, A055263, A131955. %K A131954 easy,nonn,base %O A131954 1,2 %A A131954 _Paolo P. Lava_ and _Giorgio Balzarotti_, Jul 31 2007 %E A131954 Offset corrected by _Robert Israel_, Jun 26 2019