OFFSET
1,2
COMMENTS
The formula a(10^k) = 46^k can be easily derived from the Multinomial Theorem, inspecting the expansion of (1+1+2+3+...+9)^k, where the second '1's takes the place of '0' (since we are neglecting the zeros in the products). This formula can be generalized as follows:
Let B>1 be the base used for representation. Let D be a subset of {1,2,...,B-1}. Using base B, let A(n) be the sum of the products of the digits in D of the numbers up to n. Then, A(B^k)=(B+S-|D|)^k, where |D| is the cardinality of D and S is the sum of the elements of D. For example, in base 10, with D={1,3,5,7,9}, (i.e., A(n)= sum of the products of the odd digits of the numbers up to n) we have A(k)=(10+(1+3+5+7+9)-5)^k = 30^k.
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
Wikipedia, Multinomial theorem
FORMULA
a(10^k) = 46^k.
EXAMPLE
a(10) = 1+2+3+4+5+6+7+8+9+1 = 46
MATHEMATICA
pp[n_]:=Times@@Select[IntegerDigits[n], #>0 &]; Accumulate[pp /@ Range[100]]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Giovanni Resta, Oct 18 2012
STATUS
approved