cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A372843 a(n) is the number of parking functions of order n for which the third spot is lucky.

Original entry on oeis.org

9, 74, 783, 10266, 161221, 2955366, 61999923, 1465709426, 38566299393, 1118106929358, 35418344328439, 1217218474871946, 45110603328226845, 1793457963809111030, 76142854603540048059, 3438379224329923355106, 164560036770068513241817, 8320827788575162428573342
Offset: 3

Views

Author

Kimberly P. Hadaway, Jun 26 2024

Keywords

Comments

This sequence enumerates parking functions with lucky third spot (where a lucky spot is one which is parked in by a car which prefers that spot).

Examples

			For clarity, we write parentheses around parking functions. For n = 3, the a(3) = 9 solutions are the parking functions of length 3 with a lucky third spot: (1,1,3),(1,2,3),(1,3,1),(1,3,2),(2,1,3),(2,3,1),(3,1,1),(3,1,2),(3,2,1). There are 7 parking functions of length 3 which do not have a lucky third spot: (1,1,1),(1,1,2),(1,2,1),(1,2,2),(2,1,1),(2,1,2),(2,2,1). For all of these, the car which parks in the third spot did not prefer the third spot; these parking functions do not contribute to our count.
		

Crossrefs

Cf. A000272 (for first spot), A372842 (for second spot), A372844 (for fourth spot), and A372845 (for fifth spot).

Programs

  • Mathematica
    a[n_]:=(2/3)*(n+1)^(n-1)-(1/3)*(2n-1)*(n-2)^(n-2); Array[a,18,3] (* Stefano Spezia, Jun 26 2024 *)
  • Python
    def A372843(n): return (((n+1)**(n-1)<<1)-((n<<1)-1)*(n-2)**(n-2))//3 # Chai Wah Wu, Jun 26 2024

Formula

a(n) = (2/3)*(n+1)^(n-1) - (1/3)*(2*n-1)*(n-2)^(n-2).