login
Numbers that can be written as a sum of numbers using only nonzero decimal digits in ascending order.
3

%I #22 May 09 2014 22:51:04

%S 45,54,63,72,81,90,99,108,117,126,135,144,153,162,171,180,189,198,207,

%T 216,225,234,252,261,270,279,288,315,324,333,342,378,387,396,432,441,

%U 450,459,486,495,504,513,549,558,567,576,594,603,612,621,630,666

%N Numbers that can be written as a sum of numbers using only nonzero decimal digits in ascending order.

%C The sequence is divisible by 9 and contains 187 terms. The first term is 45 = 1+2+...+9, the last term is 1+23456789 = 23456790.

%C The decomposition is not unique, for example 666 = 1+2+3+4+567+89 = 123+456+78+9.

%H Michel Lagneau, <a href="/A242226/b242226.txt">Table of n, a(n) for n = 1..187</a>

%H Michel Lagneau, <a href="/A242226/a242226_1.pdf">decompositions of the numbers</a>

%e 45 = 1+2+3+4+5+6+7+8+9;

%e 54 = 12+3+4+5+6+7+8+9;

%e 63 = 1+23+4+5+6+7+8+9;

%e 72 = 1+2+34+5+6+7+8+9;

%e 81 = 1+2+3+45+6+7+8+9 = 12+34+5+6+7+8+9;

%e 90 = 1+2+3+4+56+7+8+9 = 12+3+45+6+7+8+9;

%e 99 = 1+2+3+4+5+67+8+9 = 12+3+4+56+7+8+9 = 1+23+45+6+7+8+9.

%p g:= proc(i, j) option remember;

%p `if`(i=j, {i}, {parse(cat(seq(h, h=i..j))),

%p seq(seq(seq(x+y, y=g(h+1, j)), x=g(i, h)), h=i..j-1)})

%p end:

%p sort([(g(1, 9) minus {123456789})[]])[]; # _Alois P. Heinz_, May 09 2014

%Y Cf. A008591.

%K nonn,base,fini,full

%O 1,1

%A _Michel Lagneau_, May 08 2014