login
A372842
a(n) is the number of parking functions of order n for which the second spot is lucky.
5
2, 11, 87, 908, 11824, 184944, 3381341, 70805696, 1671605646, 43938023168, 1272792377875, 40291409169408, 1383927524621468, 51265193822056448, 2037343816037147001, 86467962304018300928, 3903480077867017448410, 186771397981175865606144, 9441767566333191196904591
OFFSET
2,1
COMMENTS
This sequence enumerates parking functions with lucky second spot (where a lucky spot is one which is parked in by a car which prefers that spot).
LINKS
FORMULA
a(n) = (3/4)*(n+1)^(n-1) - (1/4)*(n-1)^(n-1).
EXAMPLE
For clarity, we write parentheses around parking functions. For n = 2, the a(2) = 2 solutions are the parking functions of length 2 with a lucky second spot are (1,2) and (2,1). The parking function (1,1) is not one of the solutions because the car which parks in the second spot did not prefer the second spot; this parking function does not contribute to our count.
MATHEMATICA
Array[(3/4)*(# + 1)^(# - 1) - (1/4)*(# - 1)^(# - 1) &, 19, 2] (* Michael De Vlieger, Jun 26 2024 *)
PROG
(Python)
def A372842(n): return 3*(n+1)**(n-1)-(n-1)**(n-1)>>2 # Chai Wah Wu, Jun 26 2024
CROSSREFS
Cf. A000272 (for first spot), A372843 (for third spot), A372844 (for fourth spot), and A372845 (for fifth spot).
Sequence in context: A331876 A305537 A036076 * A047797 A107096 A361599
KEYWORD
nonn
AUTHOR
Kimberly P. Hadaway, Jun 20 2024
STATUS
approved