OFFSET
3,2
COMMENTS
Number of permutations of length n guessed by a cyclic shifting strategy in 3 guesses such that the first correct entry occurs on guess 1. In other words, non-derangements guessable by cyclic shift in 3 guesses.
LINKS
Aurora Hiveley, Experimenting with Permutation Wordle, arXiv:2506.23452 [math.CO], 2025.
Index entries for linear recurrences with constant coefficients, signature (10,-40,82,-91,52,-12).
FORMULA
a(n) = 1 - 2^(n+1) + 3^n + n^2/2 + 5*n/2 - n*2^n.
a(n) = Sum_{k=1..n-3} binomial(n,k)*(2^(n-k) - 2*n + 2*k - 1).
G.f.: x^4 * (4 + 5*x - 39*x^2 + 40*x^3 - 12*x^4) / ((1 - x)^3 * (1 - 2*x)^2 * (1 - 3*x)). - Stefano Spezia, Jul 03 2025
EXAMPLE
For n=4, the non-derangements with 2 excedances are 1342, 2314, 2431, and 3241.
MATHEMATICA
LinearRecurrence[{10, -40, 82, -91, 52, -12}, {0, 4, 45, 251, 1078, 4054}, 28] (* Hugo Pfoertner, Jul 03 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aurora Hiveley, Jul 03 2025
STATUS
approved
