login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #25 Jun 07 2024 02:28:41

%S 1,1,2,15,104,695,5004,40271,362816,3628719,39916700,479001479,

%T 6227020656,87178291031,1307674367804,20922789887775,355687428095744,

%U 6402373705727711,121645100408831676,2432902008176639639,51090942171709439600,1124000727777607679559,25852016738884976639516

%N a(n) = n! - n^2 + 2n - 1.

%C The number of distinct cards in a deck that has each card twice to perform the n-card trick, where the assistant chooses the hidden card. This number corresponds to a particular strategy, where if there is a duplicate card, then the assistant puts one of those duplicates on the far left and hides the other. The assistant then arranges all the other cards in nondecreasing order. If there are no duplicates, the strategy is similar to the standard one.

%H Aria Chen, Tyler Cummins, Rishi De Francesco, Jate Greene, Tanya Khovanova, Alexander Meng, Tanish Parida, Anirudh Pulugurtha, Anand Swaroop, and Samuel Tsui, <a href="https://arxiv.org/abs/2405.21007">Card Tricks and Information</a>, arXiv:2405.21007 [math.HO], 2024. See p. 19.

%H Michael Kleber and Ravi Vakil, <a href="https://web.northeastern.edu/seigen/11Magic/Articles/Best%20Card%20Trick.pdf">The best card trick</a>, The Mathematical Intelligencer 24 (2002), 9-11.

%F E.g.f.: 1/(1 - x) - exp(x)*(1 - x + x^2). - _Stefano Spezia_, Jun 06 2024

%t Table[(n! - n^2 + 2 n - 1), {n, 1, 25}]

%o (Python)

%o from math import factorial

%o def A372264(n): return factorial(n)-(n-1)**2 # _Chai Wah Wu_, May 02 2024

%Y Cf. A370888, A371217, A372255, A372256.

%K nonn,easy

%O 1,3

%A _Tanya Khovanova_ and the MIT PRIMES STEP junior group, Apr 24 2024