login
A131954
a(n) = sum of digits of (n! + a(n-1)), with a(1)=1.
5
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,2
COMMENTS
If n >= 5, then 9 divides a(n); see comment in A004152. - Bernard Schott, Jun 27 2019
LINKS
FORMULA
a(n) = Sum_digits(n!+a(n-1)).
EXAMPLE
a(4) = Sum_digits(4!+9) = 6.
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
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
EXTENSIONS
Offset corrected by Robert Israel, Jun 26 2019
STATUS
approved