A130835
Sum of all numbers having n or fewer digits and having the sum of their digits equal to n.
Original entry on oeis.org
1, 33, 1110, 38885, 1399986, 51333282, 1906666476, 71499999285, 2701111108410, 102631111100848, 3917722222183045, 150126888888738762, 5771538888888311735, 222499777777775552780, 8598259999999991401740, 332968856666666633369781, 12918171566666666537484951
Offset: 1
Take n = 3. The numbers to be summed are 111, 3, 30, 300, 210, 201, 120, 102, 21 and 12, which add to 1110.
-
A007953 := proc(n) add(i,i=convert(n,base,10)) ; end: A130835 := proc(n) local a,i; a := 0 ; for i from 1 to 10^n-1 do if A007953(i) = n then a := a+i ; fi ; od ; RETURN(a) ; end: seq(A130835(n),n=1..4) ; # R. J. Mathar, Aug 01 2007
# second Maple program:
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)*(10^n-1)/9:
seq(a(n), n=1..20); # Alois P. Heinz, Nov 02 2009
A332690
Sum of all numbers in bijective base-9 numeration with digit sum n.
Original entry on oeis.org
0, 1, 12, 124, 1248, 12496, 124992, 1249984, 12499968, 124999936, 1249999862, 12499999623, 124999998144, 1249999984364, 12499999840480, 124999998308464, 1249999981991936, 12499999808733888, 124999997974967808, 1249999978624935680, 12499999774999871588
Offset: 0
a(2) = 12 = 2 + 10 = 2_bij9 + 11_bij9.
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Wikipedia, Bijective numeration
- Index entries for linear recurrences with constant coefficients, signature (10,1,-8,-17,-26,-35,-44,-53,-62,-81,-72,-63,-54,-45,-36,-27,-18,-9).
-
b:= proc(n) option remember; `if`(n=0, [1, 0], add((p->
[p[1], p[2]*9+p[1]*d])(b(n-d)), d=1..min(n, 9)))
end:
a:= n-> b(n)[2]:
seq(a(n), n=0..23);
A332691
Bijective base-9 representation of the sum of all numbers in bijective base-9 numeration with digit sum n.
Original entry on oeis.org
1, 13, 147, 1636, 18124, 199399, 2314581, 25461653, 281178597, 3192976395, 35233852789, 387573484456, 4374418444135, 48228613881184, 541525753635894, 5956784387951128, 66635738355523786, 743994232656361639, 8285146556418623572, 92246623188575957748
Offset: 1
a(2) = 13_bij9 = 12 = 2 + 10 = 2_bij9 + 11_bij9.
-
b:= proc(n) option remember; `if`(n=0, [1, 0], add((p->
[p[1], p[2]*9+p[1]*d])(b(n-d)), d=1..min(n, 9)))
end:
g:= proc(n) local d, l, m; m, l:= n, "";
while m>0 do d:= irem(m, 9, 'm');
if d=0 then d:=9; m:= m-1 fi; l:= d, l
od; parse(cat(l))
end:
a:= n-> g(b(n)[2]):
seq(a(n), n=1..23);
A258800
The number of zeroless decimal numbers whose digital sum is n.
Original entry on oeis.org
0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 511, 1021, 2040, 4076, 8144, 16272, 32512, 64960, 129792, 259328, 518145, 1035269, 2068498, 4132920, 8257696, 16499120, 32965728, 65866496, 131603200, 262947072, 525375999, 1049716729, 2097364960, 4190597000, 8372936304, 16729373488, 33425781248
Offset: 0
a(0) = 0 since there exists no decimal number lacking a zero whose digital sum is zero.
a(1) = 1 since there exists only one zeroless decimal number whose digital sum is one and that number is 1.
a(2) = 2 since there exist only two zeroless decimal numbers whose digital sum is two and they are 2 & 11.
a(3) = 4 since there exist only four zeroless decimal numbers whose digital sum is three and they are 3, 21, 12 & 111.
a(4) = 8 since there exist only eight zeroless decimal numbers whose digital sum is four and they are 4, 31, 13, 22, 211, 121, 112 & 1111.
Cf.
A125630,
A125858,
A125858,
A125880,
A125897,
A125904,
A125908,
A125909,
A125910,
A125945,
A125946,
A125947,
A125948,
A126627,
A126628,
A126629,
A126631,
A126632,
A126633,
A126634,
A126635,
A126639,
A126640,
A126641,
A126642,
A126643,
A126644,
A126645,
A126646,
A126718.
-
CoefficientList[ Series[-1 + 1/(1 - x (1 + x + x^2) (1 + x^3 + x^6)), {x, 0, 36}], x]
Showing 1-4 of 4 results.
Comments