OFFSET
1,1
COMMENTS
EXAMPLE
666 = 1+2+3+4+567+89 = 9+87+6+543+21.
MAPLE
g:= proc(i, j, t) option remember; `if`(i=j, {`if`(t=1, i, 10-i)},
{parse(cat(seq(`if`(t=1, h, 10-h), h=i..j))), seq(seq(
seq(x+y, y=g(h+1, j, t)), x=g(i, h, t)), h=i..j-1)})
end:
sort([(g(1, 9, 1) intersect g(1, 9, 0))[]])[]; # Alois P. Heinz, May 09 2014
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Michel Lagneau, May 09 2014
STATUS
approved