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.

A062813 a(n) = Sum_{i=0..n-1} i*n^i.

Original entry on oeis.org

0, 2, 21, 228, 2930, 44790, 800667, 16434824, 381367044, 9876543210, 282458553905, 8842413667692, 300771807240918, 11046255305880158, 435659737878916215, 18364758544493064720, 824008854613343261192, 39210261334551566857170, 1972313422155189164466189, 104567135734072022160664820
Offset: 1

Views

Author

Olivier Gérard, Jun 23 2001

Keywords

Comments

Largest Katadrome (number with digits in strict descending order) in base n.
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
Permutational numbers A134640 isomorphic with permutation matrix generators of cyclic groups, n-th root of unity matrices. - Artur Jasinski, Nov 07 2007
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

Crossrefs

Last elements of rows of A061845 (for n>1).

Programs

  • Haskell
    a062813 n = foldr (\dig val -> val * n + dig) 0 [0 .. n - 1]
    -- Reinhard Zumkeller, Aug 29 2014
    
  • Maple
    0,seq(n*((n-2)*n^n + 1)/(n-1)^2,n=2..100); # Robert Israel, Sep 03 2014
  • Mathematica
    Table[Sum[i*n^i, {i, 0, -1 + n}], {n, 17}] (* Olivier Gérard, Jun 23 2001 *)
    a[n_] := FromDigits[ Range[ n-1, 0, -1], n]; Array[a, 18] (* Robert G. Wilson v, Sep 03 2014 *)
  • PARI
    a(n) = sum(i=0,n-1,i*n^i)
    
  • PARI
    a(n) = if (n==1,0, my(t=n^n); t-(t-n)/(n-1)^2); \\ Joerg Arndt, Sep 03 2014
    
  • Python
    def A062813(n): return (m:=n**n)-(m-n)//(n-1)**2 if n>1 else 0 # Chai Wah Wu, Mar 18 2024

Formula

a(n) = n^n - (n^n-n)/(n-1)^2 for n>1. - Dean Hickerson, Jun 26 2001
a(n) = A134640(n, A000142(n)). - Reinhard Zumkeller, Aug 29 2014