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.

A068476 a(n) = Sum_{m=1..n} m*n^(m+(-1)^n).

Original entry on oeis.org

0, 1, 20, 34, 5008, 3711, 1948356, 937924, 1205220416, 429794605, 1098765432100, 310989720966, 1390027428561168, 326011399456939, 2332600912091693348, 466937872906120456, 5016202619581534249216, 875711370981239308953
Offset: 0

Views

Author

Francois Jooste (phukraut(AT)hotmail.com), Mar 10 2002

Keywords

Examples

			a(2) = 2^(1+1)+2*2^(2+1) = 4+16 = 20.
		

Crossrefs

Cf. A062806 (without the (-1)^n).

Programs

  • Magma
    [0] cat [(&+[m*n^(m+(-1)^n): m in [1..n]]): n in [1..30]]; // G. C. Greubel, Oct 13 2018
  • Maple
    b := n->sum(m*n^(m+(-1)^n),m=1..n);
    # Alternative:
    f:= n -> n^(1+(-1)^n)*(n^n*(n^2-n-1)+1)/(n-1)^2:
    f(0):= 0: f(1):= 1:
    map(f, [$0..40]);
  • Mathematica
    Table[Sum[m*n^(m+(-1)^n), {m,1,n}], {n,0,30}] (* G. C. Greubel, Oct 13 2018 *)
  • PARI
    a(n) = sum(m=1, n, m*n^(m+(-1)^n)); \\ Michel Marcus, Nov 15 2017
    

Formula

If n >= 2, a(n) = n^(1+(-1)^n)*(n^n*(n^2-n-1)+1)/(n-1)^2. - Robert Israel, Nov 15 2017