cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A071268 Sum of all digit permutations of the concatenation of first n numbers.

Original entry on oeis.org

1, 33, 1332, 66660, 3999960, 279999720, 22399997760, 2015999979840, 201599999798400, 927359999990726400, 1064447999999893555200, 2058376319999997941623680, 4439635199999999955603648000, 10585935359999999998941406464000, 27655756127999999999972344243872000
Offset: 1

Views

Author

Amarnath Murthy, Jun 01 2002

Keywords

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

Examples

			For n=3, a(3) = 123 + 132 + 213 + 231 + 312 + 321 = 1332. - _Michael B. Porter_, Aug 28 2016
		

Crossrefs

Programs

  • 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 *)
  • 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

Formula

a(n) = (n + 1)!*(10^n - 1)/18 for 1 <= n <= 9.
a(n) = ((10^A055642(A007908(n))-1)/9)*(A047726(A007908(n))*A007953(A007908(n))/(A055642(A007908(n)))). - Altug Alkan, Aug 28 2016

Extensions

Edited by Robert G. Wilson v, Jun 03 2002
Corrected by Altug Alkan, Aug 28 2016