A276643 Number of distinct 4-digit vehicle plates whose sum is n.
1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 282, 348, 415, 480, 540, 592, 633, 660, 670, 660, 633, 592, 540, 480, 415, 348, 282, 220, 165, 120, 84, 56, 35, 20, 10, 4, 1
Offset: 0
Examples
a(0) = 1 because 0000 is the only plate which sums to 0. a(1) = 4 because there are 4 plates which sum to 1: 0001, 0010, 0100 and 1000. a(2) = 10 because there are 10 numbers whose digits sum to 2: 2, 11, 20, 101, 110, 200, 1001, 1010, 1100, 2000. - _Miquel Cerda_, Jun 14 2017
Crossrefs
Cf. A213651.
Programs
-
Mathematica
Length /@ Split@ Sort@ Map[Total, IntegerDigits@ Range[0, 10^4 - 1]] (* Michael De Vlieger, May 03 2017 *)
-
PARI
{ my(x='x+O('x^44)); Vec(sum(k=0,9,x^k)^4) } \\ Joerg Arndt, May 02 2017
-
R
library(dplyr) data=expand.grid(0:9, 0:9, 0:9, 0:9, KEEP.OUT.ATTRS = FALSE) data %>% mutate(n=Var1+Var2+Var3+Var4) %>% group_by(n) %>% summarise(value=n()) -> suc View(suc)
Comments