OFFSET
1,2
COMMENTS
222 can be expressed so in two different ways, i.e., 222 = 200 + 020 + 002 as well as 222 = 101 + 110 + 011. Problem: find a number which can be so expressed in n different ways.
LINKS
David W. Wilson, Table of n, a(n) for n = 1..9450
FORMULA
From David W. Wilson, Jul 12 2007: (Start)
Let f(n) be the sum of all permuted versions of n. Let
s(n) = sum of digits of n.
d(n) = number of digits of n.
c_n(k) = number of occurrences of digit k in n.
p(n) = Product_{k=0..9} c_n(k)!.
r(n) = n-digit rep-1 number = (10^n-1)/n.
t(n) = s(n)*(d(n)-1)!/p(n).
Then f(n) = t(n)*r(d(n)).
For example, if n = 314159, we get
s(n) = 23
d(n) = 6
c_n = (0, 2, 0, 1, 1, 1, 0, 0, 0, 1)
p(n) = Product_{k=0..9} c_n(k)! = 2
r(d(n)) = r(6) = 111111
t(n) = 23*120/2 = 1380
and
f(314159) = 1380*11111 = 153333180. (End)
EXAMPLE
1110 is a term as it is the sum of all distinct permutations of 104, i.e., 104+140+410+401+014+041 = 1110.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Jun 01 2002
EXTENSIONS
Corrected and extended by Diana L. Mecum, Jul 06 2007
STATUS
approved