A211072
Sum of numbers with no '0' decimal digits whose sum of digits equals n.
Original entry on oeis.org
0, 1, 13, 147, 1625, 17891, 196833, 2165227, 23817625, 261994131, 2881935943, 31701296375, 348714262017, 3835856884757, 42194425724149, 464138682802857, 5105525508895321, 56160780576260645, 617768586100819485, 6795454444489330049, 74749998860563784655
Offset: 0
2 and 11 are the only numbers without 0's which have digit sum 2, so a(2) = 2 + 11 = 13.
- Alois P. Heinz, Table of n, a(n) for n = 0..961 (terms n = 1..31 from Laurent Desnogues)
- Project Euler, Problem 377: Sum of digits, experience 13
- Tadao Takaoku, A two-level algorithm for generating multiset permutations, RIMS Kokyuroku 1644 (2009), pp. 95-109.
- Index entries for linear recurrences with constant coefficients, signature (11,1,-9,-19,-29,-39,-49,-59,-69,-90,-80,-70,-60,-50,-40,-30,-20,-10).
-
b:= proc(n) option remember; `if`(n=0, [1, 0], add((p->
[p[1], p[2]*10+p[1]*d])(b(n-d)), d=1..min(n, 9)))
end:
a:= n-> b(n)[2]:
seq(a(n), n=0..23); # Alois P. Heinz, Feb 19 2020
A167403
Number of decimal numbers having n or fewer digits and having the sum of their digits equal to n.
Original entry on oeis.org
1, 3, 10, 35, 126, 462, 1716, 6435, 24310, 92368, 352595, 1351142, 5194385, 20024980, 77384340, 299671971, 1162635441, 4518099300, 17583582225, 68522664400, 267350823015, 1044243559263, 4082760176300, 15977236602150, 62576817828876, 245279492151021
Offset: 1
-
b:= proc(n, i) option remember;
`if`(n=0, 1, `if`(i=0, 0,
add(b(n-j, i-1), j=0..min(n, 9)) ))
end:
a:= n-> b(n, n):
seq(a(n), n=1..30);
A331672
Sum of all base-n numbers with digit sum n and length at most n.
Original entry on oeis.org
3, 91, 2635, 94501, 4254936, 234572213, 15403880115, 1176838159861, 102631111100848, 10063085278250005, 1095923297151849530, 131253123286275198027, 17145216226230367266330, 2425892898650501790637545, 369599184391990522425455939, 60326656013944234430010524773
Offset: 2
a(2) = 3 = 11_2.
a(3) = 91 = 5 + 7 + 11 + 13 + 15 + 19 + 21 = 12_3 + 21_3 + 102_3 + 111_3 + 120_3 + 201_3 + 210_3.
a(10) = A130835(10) = 102631111100848.
-
b:= proc(n, i, k) option remember; `if`(n=0, [1, 0],
`if`(i=0, 0, add((p->[p[1], p[2]*k+p[1]*d])(
b(n-d, i-1, k)), d=0..min(n, k-1))))
end:
a:= n-> b(n$3)[2]:
seq(a(n), n=2..17);
# second Maple program:
a:= n-> (binomial(2*n-1, n)-n)*(n^n-1)/(n-1):
seq(a(n), n=2..17);
A331673
Sum of all base-n numbers with digit sum n and length exactly n.
Original entry on oeis.org
3, 79, 2299, 84361, 3872406, 216591677, 14378073683, 1107635176621, 97229999995138, 9583904327477305, 1048274845801847390, 126003010469828661807, 16510208629407273871884, 2342241434486480710216185, 357676630651821282153992579, 58498575553741083746904253333
Offset: 2
a(2) = 3 = 11_2.
a(3) = 79 = 11 + 13 + 15 + 19 + 21 = 102_3 + 111_3 + 120_3 + 201_3 + 210_3.
-
b:= proc(n, i, k) option remember; `if`(n=0, [1, 0],
`if`(i=0, 0, add((p->[p[1], p[2]*k+p[1]*d])(
b(n-d, i-1, k)), d=0..min(n, k-1))))
end:
a:= n-> b(n$3)[2]-b(n, n-1, n)[2]:
seq(a(n), n=2..17);
Showing 1-4 of 4 results.
Comments