OFFSET
1,2
COMMENTS
The permutations yield n! different numbers and if they are stacked vertically then the sum of each column is (n-1)! times the n-th triangular number = (n-1)!*n(n+1)/2. a(n) = [(n+1)!/2]*[{10^n -1}/9]. Note that this is only valid for 1 <= n <= 9.
The first person who studied the sum of different permutations of digits of a given number seems to be the French scientist Eugène Aristide Marre (1823-1918). See links. - Bernard Schott, Dec 07 2012
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..208, Jan 04 2019
A. Marre, Trouver la somme de toutes les permutations différentes d'un nombre donné., Nouvelles Annales de Mathématiques, 1ère série, tome 5 (1846), p. 57-60.
Norbert Verdier and Raymond Cordier, QDV4 : Marre, Marre et Marre, page=1 (French mathematical forum les-mathematiques.net)
FORMULA
EXAMPLE
For n=3, a(3) = 123 + 132 + 213 + 231 + 312 + 321 = 1332. - Michael B. Porter, Aug 28 2016
MAPLE
a:= proc(n) local s, t, l;
s:= cat("", seq(i, i=1..n)); t:= length(s);
l:= (p-> seq(coeff(p, x, i), i=0..9))(add(x^parse(s[i]), i=1..t));
(10^t-1)/9*combinat[multinomial](t, l)*add(i*l[i+1], i=1..9)/t
end:
seq(a(n), n=1..20); # Alois P. Heinz, Jan 04 2019
MATHEMATICA
Table[Total@ Map[FromDigits, Permutations@ Flatten@ Map[IntegerDigits, Range@ n]], {n, 10}] (* or *)
Table[Function[d, (((10^Length@ d - 1)/9)* Length@ Union@ Map[FromDigits, Permutations@ d] Total[d])/Length@ d]@ Flatten@ Map[IntegerDigits, Range@ n], {n, 11}] (* Michael De Vlieger, Aug 30 2016, latter after Harvey P. Dale at A047726 *)
PROG
(PARI) A007908(n) = my(s=""); for(k=1, n, s=Str(s, k)); eval(s);
A047726(n) = n=eval(Vec(Str(n))); (#n)!/prod(i=0, 9, sum(j=1, #n, n[j]==i)!);
A055642(n) = #Str(n);
A007953(n) = sumdigits(n);
a(n) = ((10^A055642(A007908(n))-1)/9)*(A047726(A007908(n))*A007953(A007908(n))/(A055642(A007908(n)))); \\ Altug Alkan, Aug 28 2016
(Python)
from math import factorial
from operator import mul
from functools import reduce
def A071268(n):
s = ''.join(str(i) for i in range(1, n+1))
return sum(int(d) for d in s)*factorial(len(s)-1)*(10**len(s)-1)//(9*reduce(mul, (factorial(d) for d in (s.count(w) for w in set(s))))) # Chai Wah Wu, Jan 04 2019
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Jun 01 2002
EXTENSIONS
Edited by Robert G. Wilson v, Jun 03 2002
Corrected by Altug Alkan, Aug 28 2016
STATUS
approved