OFFSET
4,1
COMMENTS
A lucky spot is one which is parked in by a car which prefers that spot.
FORMULA
a(n) = (5/8)*(n+1)^(n-1) - (1/8)*(13*n^2 - 26*n + 9)*(n-3)^(n-3).
EXAMPLE
For clarity, we write parentheses around parking functions. For n = 4, there are a(4) = 64 solutions. An example of a parking function of order 4 with a lucky fourth spot is (1,4,2,2); here, the second car parks in the fourth spot which is its preferred spot. This parking function contributes to our count. A non-example is the parking function (1,2,1,2); here, the last car parks in the fourth spot, but its preference is spot 2. This parking function does not contribute to our count.
MATHEMATICA
a[n_]:=(5/8)*(n+1)^(n-1)-(1/8)*(13*n^2-26*n+9)*(n-3)^(n-3); Array[a, 19, 4] (* Stefano Spezia, Jun 26 2024 *)
PROG
(Python)
def A372844(n): return 5*(n+1)**(n-1)-(13*(n-1)**2-4)*(n-3)**(n-3)>>3 # Chai Wah Wu, Jun 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Kimberly P. Hadaway, Jun 26 2024
STATUS
approved