OFFSET
0,11
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000 (terms 1..1000 from G. C. Greubel)
EXAMPLE
a(12) = binomial(12,3) = 220.
MAPLE
P:=proc(n) local a, i, k, w; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=binomial(i, w); print(a); od; end: P(100);
a:=proc(n) local nn, s: nn:=convert(n, base, 10): s:=sum(nn[j], j=1..nops(nn)): binomial(n, s): end: seq(a(n), n=0..38); # Emeric Deutsch, May 04 2007
MATHEMATICA
Table[Binomial[n, Total[IntegerDigits[n]]], {n, 1, 40}] (* G. C. Greubel, Feb 10 2019 *)
PROG
(PARI) a(n) = binomial(n, sumdigits(n)); \\ Michel Marcus, Feb 10 2019
(Sage) [binomial(n, sum(int(d) for d in str(n))) for n in (1..40)] # G. C. Greubel, Feb 10 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Apr 27 2007
EXTENSIONS
a(0)=1 prepended by Seiichi Manyama, Apr 24 2019
STATUS
approved