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
Michael De Vlieger, Table of n, a(n) for n = 2..387
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
KEYWORD
nonn
AUTHOR
Kimberly P. Hadaway, Jun 20 2024
STATUS
approved