login
A372845
a(n) is the number of parking functions of order n for which the fifth spot is lucky.
5
625, 8733, 140298, 2600879, 54921875, 1303885965, 34409008596, 999711522899, 31719176377701, 1091467041015625, 40491113522829630, 1611131116280526327, 68448950529246552887, 3092734133786108912869, 148090628302001953125000, 7491257174986774088059995, 399205026805287676036911049
OFFSET
5,1
COMMENTS
This sequence enumerates parking functions with lucky fifth spot (where a lucky spot is one which is parked in by a car which prefers that spot).
FORMULA
a(n) = (3/5)*(n+1)^(n-1) - (1/30)*(118*n^3 - 531*n^2 + 659*n - 192)*(n-4)^(n-4).
EXAMPLE
For clarity, we write parentheses around parking functions. For n = 6, there are a(6) = 8733 solutions. An example of a parking function of order 6 with a lucky fifth spot is (1,4,1,5,2,2); here, the fourth car parks in the fifth spot which is its preferred spot. This parking function contributes to our count. A non-example is the parking function (1,1,1,1,1,5); here, the fifth car parks in the fifth spot, but its preference is spot 1. This parking function does not contribute to our count.
MATHEMATICA
a[n_]:=(3/5)*(n+1)^(n-1)-(1/30)*(118*n^3-531*n^2+659*n-192)*(n-4)^(n-4); Array[a, 17, 5] (* Stefano Spezia, Jun 26 2024 *)
PROG
(Python)
def A372845(n): return (18*(n+1)**(n-1)-(n*(n*(59*((n<<1)-9))+659)-192)*(n-4)**(n-4))//30 # Chai Wah Wu, Jun 26 2024
CROSSREFS
Cf. A000272 (for first spot), A372842 (for second spot), A372843 (for third spot), and A372844 (for fourth spot).
Sequence in context: A143026 A238700 A064781 * A250832 A250827 A055868
KEYWORD
nonn
AUTHOR
Kimberly P. Hadaway, Jun 26 2024
STATUS
approved