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.

Showing 1-1 of 1 results.

A320453 a(n) = (n^n + n*(-1)^n)/(n + 1).

Original entry on oeis.org

0, 2, 6, 52, 520, 6666, 102942, 1864136, 38742048, 909090910, 23775972550, 685853880636, 21633936185160, 740800455037202, 27368368148803710, 1085102592571150096, 45957792327018709120, 2070863582910344082918, 98920982783015679456198, 4993219047619047619047620
Offset: 1

Views

Author

Jinyuan Wang, Oct 13 2018

Keywords

Comments

In a game in which n+1 players are passing a ball from one to another, a(n) is the number of ways that the ball can start at a given player and, on the n-th pass, return (not necessarily for the first time) to that same player. E.g., the a(3)=6 ways are A-BCA, A-CBA, A-BDA, A-DBA, A-CDA, A-DCA.

Crossrefs

Programs

  • GAP
    List([1..20],n->(n^n+n*(-1)^n)/(n+1)); # Muniru A Asiru, Oct 13 2018
    
  • Magma
    [(n^n + n*(-1)^n)/(n + 1) : n in [1..25]]; // Vincenzo Librandi, Oct 14 2018
  • Maple
    a:=n->(n^n+n*(-1)^n)/(n+1): seq(a(n),n=1..20); # Muniru A Asiru, Oct 13 2018
  • Mathematica
    Table[(n^n + n*(-1)^n)/(n + 1), {n, 0, 50}]
  • PARI
    a(n) = (n^n + n*(-1)^n)/(n + 1);
    

Formula

a(n) = (n^n + n*(-1)^n)/(n + 1).
a(n) = A000312(n+1) - A185634(n) = A185634(n)/n + (-1)^n.

Extensions

a(10)-a(20) from Muniru A Asiru, Oct 13 2018
Showing 1-1 of 1 results.