OFFSET
1,2
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.
LINKS
Muniru A Asiru, Table of n, a(n) for n = 1..385
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}]
PROG
(PARI) a(n) = (n^n + n*(-1)^n)/(n + 1);
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Jinyuan Wang, Oct 13 2018
EXTENSIONS
a(10)-a(20) from Muniru A Asiru, Oct 13 2018
STATUS
approved