

A066956


a(n) is the number of ways of placing '+' and '' among the digits 123456789 so that the result of the expression is n, '' before 1 not allowed.


3



11, 26, 11, 18, 8, 21, 12, 17, 8, 22, 12, 21, 11, 16, 15, 20, 8, 17, 11, 20, 15, 16, 11, 23, 18, 13, 14, 21, 15, 19, 17, 14, 19, 19, 7, 14, 19, 19, 17, 18, 16, 17, 18, 10, 15, 26, 18, 15, 16, 12, 17, 19, 9, 17, 21, 16, 13, 14, 16, 17, 17, 11, 13, 22, 14, 13, 15, 15, 15, 17, 7
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,1


COMMENTS

a(n) = 0 for all but finitely many n. In particular, a(n) = 0 for n > 123456789.  Charles R Greathouse IV, Aug 20 2012


LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..34668


EXAMPLE

a(4) = 8 because 4 = 1234567+89 = 1234567+8+9 = 123+4567+8+9 = 123+45+6+789 = 123+4+567+89 = 12+345+67+89 = 12+34+5678+9 = 1+234+5+6+7+8+9 and only for these.


PROG

(Python)
from collections import Counter
from itertools import product, zip_longest
def aupton(nn):
digs = list("123456789")
c = Counter(eval("".join(filter(None, sum(zip_longest(digs, ops), ())))) for ops in product(["", "+", ""], repeat=8))
return [c[k] for k in range(nn+1)]
print(aupton(70)) # Michael S. Branicky, Nov 26 2021


CROSSREFS

Cf. A066957.
Sequence in context: A043940 A220434 A191720 * A250611 A137015 A260903
Adjacent sequences: A066953 A066954 A066955 * A066957 A066958 A066959


KEYWORD

nice,nonn,base


AUTHOR

Miklos SZABO (mike(AT)ludens.elte.hu), Feb 01 2002


STATUS

approved



