OFFSET
2,2
COMMENTS
a(n)/(n-1)! is the average number of loops when n players are randomly taking the name of another player (excluding their own name). This is just referring to a game called the "Guardian angel" proposed by a former colleague at work.
For n>2, a(n) appears to be divisible by 2n-4 and, for n>5, additionally by either 10 or 30. - Ralf Stephan, Dec 17 2013
LINKS
Martin Y. Champel, Table of n, a(n) for n = 2..99
FORMULA
a(n) = (n-1)! * S(n), with S(n) = 1 + 1/(n-1) * sum of previous S(i) with i in (2, n-2).
EXAMPLE
For example, if, among 5 players A,B,C,D,E, A takes C and C takes B and B takes A, one loop would be ACB and the other loop would be DE. No single element loop is allowed.
For n = 2, the only possible loop is a 2 elements loop AB ==> a(2) = 1.
for n = 3, the only possible loop is a 3 elements loop ABC or ACB ==> a(3) = 2 as a(3) / 2! = 1.
for n = 4, there are two types of loop, the ABCD loop and AB + CD loops, there is 2 chances out of 3 to get the ABCD type loop and 1 chance out of 3 to get the "AB + CD" configuration. The average number of loop is therefore 2/3 X 1 + 1/3 X 2 = 4/3 = 8 / 6 = a(4)/3!.
for n = 5, there are two types of loop, the ABCDE loop and ABC + DE loops, there is 2 chances out of 4 to get the ABCDE type loop and 2 chance out of 4 to get the "ABC + DE" configuration. The average number of loop is therefore 2/4 X 1 + 2/4 X 2 = 6/4 = 36 / 24 = a(5)/4!.
MATHEMATICA
S[1] = 1;
S[n_] := S[n] = 1 + 1/(n-1) (S /@ Range[2, n-2] // Total);
a[n_] := (n-1)! S[n];
a /@ Range[2, 99] (* Jean-François Alcover, Sep 19 2020 *)
PROG
(Python)
from sympy import factorial, Integer
angel=[0, 0, 1, 1]
A233744=[1, 2]
n = 20
for i in range(4, n):
new = 1+sum(angel[:-1])/Integer(i-1)
angel.append(new)
A233744.append(new*factorial(i-1))
print(A233744)
(PARI) S(n)=if(n<2, 1, 1+sum(i=2, n-2, S(i))/(n-1)); a(n)=(n-1)!*S(n) \\ Ralf Stephan, Dec 17 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Martin Y. Champel, Dec 15 2013
EXTENSIONS
More terms from Ralf Stephan, Dec 17 2013
STATUS
approved