%I #53 Apr 04 2024 10:13:31
%S 0,2,21,228,2930,44790,800667,16434824,381367044,9876543210,
%T 282458553905,8842413667692,300771807240918,11046255305880158,
%U 435659737878916215,18364758544493064720,824008854613343261192,39210261334551566857170,1972313422155189164466189,104567135734072022160664820
%N a(n) = Sum_{i=0..n-1} i*n^i.
%C Largest Katadrome (number with digits in strict descending order) in base n.
%C The largest permutational number (A134640) of order n. These numbers are isomorphic with antidiagonal permutation matrices of order n. Where diagonal matrices are a[i,1+n-i]=1 {i=1,n} a[i<>1+n-i]=0 for smallest permutational numbers of order n see A023811. - _Artur Jasinski_, Nov 07 2007
%C Permutational numbers A134640 isomorphic with permutation matrix generators of cyclic groups, n-th root of unity matrices. - _Artur Jasinski_, Nov 07 2007
%C Rephrasing: Largest pandigital number in base n (in the sense of A050278, which is base 10); e.g., a(10) = A050278(3265920), its final term. With a(1) = 1 instead of 0, also accommodates unary (A000042). - _Rick L. Shepherd_, Jul 10 2017
%H Reinhard Zumkeller, <a href="/A062813/b062813.txt">Table of n, a(n) for n = 1..400</a>
%H Chai Wah Wu, <a href="https://arxiv.org/abs/2403.20304">Pandigital and penholodigital numbers</a>, arXiv:2403.20304 [math.GM], 2024. See p. 1.
%F a(n) = n^n - (n^n-n)/(n-1)^2 for n>1. - _Dean Hickerson_, Jun 26 2001
%F a(n) = A134640(n, A000142(n)). - _Reinhard Zumkeller_, Aug 29 2014
%p 0,seq(n*((n-2)*n^n + 1)/(n-1)^2,n=2..100); # _Robert Israel_, Sep 03 2014
%t Table[Sum[i*n^i, {i, 0, -1 + n}], {n, 17}] (* _Olivier Gérard_, Jun 23 2001 *)
%t a[n_] := FromDigits[ Range[ n-1, 0, -1], n]; Array[a, 18] (* _Robert G. Wilson v_, Sep 03 2014 *)
%o (PARI) a(n) = sum(i=0,n-1,i*n^i)
%o (PARI) a(n) = if (n==1,0, my(t=n^n); t-(t-n)/(n-1)^2); \\ _Joerg Arndt_, Sep 03 2014
%o (Haskell)
%o a062813 n = foldr (\dig val -> val * n + dig) 0 [0 .. n - 1]
%o -- _Reinhard Zumkeller_, Aug 29 2014
%o (Python)
%o def A062813(n): return (m:=n**n)-(m-n)//(n-1)**2 if n>1 else 0 # _Chai Wah Wu_, Mar 18 2024
%Y Last elements of rows of A061845 (for n>1).
%Y Cf. A134640, A134641, A134642, A134643, A134644, A023811, A062808.
%Y Cf. A000142, A000042, A050278.
%K nonn,easy
%O 1,2
%A _Olivier Gérard_, Jun 23 2001