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.

A323416 a(n) = (n-1)! * (10^n - 1) / 9.

This page as a plain text file.
%I A323416 #53 Mar 16 2024 10:55:36
%S A323416 1,11,222,6666,266664,13333320,799999920,55999999440,4479999995520,
%T A323416 403199999959680,40319999999596800,4435199999995564800,
%U A323416 532223999999946777600,69189119999999308108800,9686476799999990313523200,1452971519999999854702848000,232475443199999997675245568000,39520825343999999960479174656000
%N A323416 a(n) = (n-1)! * (10^n - 1) / 9.
%C A323416 Take an n-digit number with distinct digits, add all permutations of the digits, divide by the sum of the digits: the result is a(n).
%C A323416 Proof from _David A. Corneth_, Jan 14 2019: (Start)
%C A323416 Let m be an n-digit number (without leading 0, where n > 0). Then n! permutations of digits can be formed.
%C A323416 So each digit occurs n!/n = (n-1)! times in each position. Therefore the total sum is (10^n - 1) * (n - 1)! * s where s is the sum of digits of n. Dividing this product by s gives a(n) = (10^n - 1) * (n - 1)!. QED (End)
%H A323416 David Cobac, <a href="/A323416/b323416.txt">Table of n, a(n) for n = 1..325</a>
%H A323416 G. Villemin, <a href="http://villemin.gerard.free.fr/aNombre/MOTIF/Permut.htm">Nombres permutés</a>
%F A323416 Recurrence relation: a(n+1) = n! * 10^n + n * a(n).
%F A323416 Proof: Assume R_n is a string of n 1's (repunit),
%F A323416 a(n) = (n-1)! * R_n so a(n+1) = n! * R_{n+1} = n! * (10^n + R_n);
%F A323416 Thus a(n+1) = n! * 10^n + n! * R_n = n! * 10^n + n * (n-1)! * R_n;
%F A323416 Hence a(n+1) = n! * 10^n + n * a(n).
%e A323416 Example for n = 3:
%e A323416 Take the number 569.
%e A323416 Sum the permutations of its digits: 569 + 596 + 659 + 695 + 956 + 965 = 4440.
%e A323416 Add all its digits: 5 + 6 + 9 = 20.
%e A323416 Divide: 4440 / 20 = 222.
%e A323416 General proof for n = 3:
%e A323416 Number: abc where a,b,c are distinct.
%e A323416 The sum of the permutations is 200*(a+b+c) + 20*(a+b+c) + 2*(a+b+c) = 222*(a+b+c), so a(3) = 222.
%t A323416 Table[(n-1)! (10^n-1)/9,{n,20}] (* _Harvey P. Dale_, Mar 15 2024 *)
%o A323416 (Python)
%o A323416 f = lambda n:+(n==0) or n*f(n-1)
%o A323416 def seq(n):
%o A323416    if n==0: return
%o A323416    l = []
%o A323416    for i in range(1, n + 1):
%o A323416        # following line with a string repeat
%o A323416        # s = int('1'*i)
%o A323416        s = 0
%o A323416        for j in range(i):
%o A323416            s += 10 ** j
%o A323416        l += [s*f(i-1)]
%o A323416    return l
%o A323416 (PARI) a(n) = (10^n - 1) / 9 * (n-1)! \\ _David A. Corneth_, Jan 13 2019
%Y A323416 Cf. A000142, A002275, A071267. Sum of digits A110728.
%K A323416 nonn,easy,base
%O A323416 1,2
%A A323416 _David Cobac_, Jan 13 2019
%E A323416 Edited by _N. J. A. Sloane_, Jan 19 2019