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.

Showing 1-5 of 5 results.

A370888 a(n) = (n-1)*(2*(n-2)!+1).

Original entry on oeis.org

3, 6, 15, 52, 245, 1446, 10087, 80648, 725769, 7257610, 79833611, 958003212, 12454041613, 174356582414, 2615348736015, 41845579776016, 711374856192017, 12804747411456018, 243290200817664019, 4865804016353280020, 102181884343418880021, 2248001455555215360022, 51704033477769953280023, 1240896803466478878720024
Offset: 2

Views

Author

Tanya Khovanova and PRIMES STEP junior group, Mar 05 2024

Keywords

Comments

The maximum deck size to perform the n-card trick using the Fitch Cheney method. This trick is known as the 5-card trick, where the maximum deck size is 52.
The method was later improved to serve a bigger deck described by A030495. In particular, the 5-card trick can be performed with the deck of size 124, and this size is the largest possible.
a(n) = A275929(n)-2.

References

  • Wallace Lee, Math Miracles, published by Seeman Printery, Durham, N.C., 1950.

Crossrefs

Programs

  • Mathematica
    Table[(k - 1) (2 Factorial[k - 2] + 1), {k, 2, 20}]

Formula

E.g.f.: 1 + exp(x)*(x - 1) - 2*(x - log(1 - x)). - Stefano Spezia, Jun 06 2024

A371217 The maximum deck size to perform Colm Mulcahy's n-card trick.

Original entry on oeis.org

1, 4, 15, 52, 197, 896, 4987, 33216, 257161, 2262124, 22241671, 241476060, 2867551117, 36960108680, 513753523571, 7659705147976, 121918431264273, 2063255678027668, 36991535865656959, 700377953116334788, 13963866589144933461, 292421219327021540176, 6417047546280200867819
Offset: 1

Views

Author

Tanya Khovanova and PRIMES STEP junior group, Mar 15 2024

Keywords

Comments

With this card trick the magician's assistant gets n cards from a deck, hides one card, and displays the rest, where it is allowed to place some of the displayed cards face down. After that, the magician guesses the hidden card.
The trick for n = 4 was invented by Colm Mulcahy and is a variation of the Fitch Cheney trick. Surprisingly, the largest possible deck is the standard deck of 52 cards.

Examples

			Suppose the deck consists of 4 cards (1,2,3,4), and the assistant gets two cards. If the two cards contain 4, the assistant hides 4 and signals it with the other card face down. If there is no 4, then the cards are a and a+1 modulo 3. The assistant hides a+1, and signals it with a.
		

References

  • Wallace Lee, Math Miracles, published by Seeman Printery, Durham, N.C., 1950.
  • Colm Mulcahy, Mathematical card magic: fifty-two new effects, published by CRC press, 2013.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<4, n*(n^2-2*n+2),
          ((11*n^2-66*n-61)*a(n-1) -(17*n^2-155*n+134)*a(n-2)
           +(n-3)*(n-81)*a(n-3) +(n-4)*(5*n+26)*a(n-4))/(11*n-72))
        end:
    seq(a(n), n=1..23);  # Alois P. Heinz, Mar 18 2024
  • Mathematica
    Table[1 + (k - 1)(2 Sum[Binomial[k - 1, i] (i - 1)!, {i, 1, k - 1}] + 1), {k, 20}]
  • Python
    from math import factorial
    def A371217(n): return n+((n-1)*sum(factorial(n-1)//((i+1)*factorial(n-i-2)) for i in range(n-1))<<1) # Chai Wah Wu, May 02 2024

Formula

a(n) = 1 + (n-1)*(1 + 2*Sum_{i=1..n-1} (i-1)!*binomial(n-1, i)).
a(n) mod 2 = n mod 2 = A000035(n). - Alois P. Heinz, Mar 22 2024
a(n) ~ 2*exp(1)*(n-1)!. - Vaclav Kotesovec, Jul 27 2024

A054119 a(n) = n! + (n-1)! + (n-2)!.

Original entry on oeis.org

1, 2, 4, 9, 32, 150, 864, 5880, 46080, 408240, 4032000, 43908480, 522547200, 6745939200, 93884313600, 1401079680000, 22317642547200, 377917892352000, 6778983923712000, 128403161542656000, 2560949482291200000, 53645489280294912000, 1177524571957493760000, 27027108408834293760000
Offset: 0

Views

Author

Keywords

Comments

In factorial base representation (A007623) the terms are written as: 1, 10, 20, 111, 1110, 11100, 111000, ... From a(3) = 9 = "111" onward each term begins always with three consecutive 1's, followed by n-3 zeros. - Antti Karttunen, Sep 24 2016

Crossrefs

Equals T(n, 3), array T as in A054115.
Row 6 of A276955 (from a(3)=9 onward).

Programs

Formula

For n>2, a(n) = (n-2)! * n^2. [Gary Detlefs, Aug 01 2009]
a(n) = (n+1)!*(H(n-1)+H(n+1)-H(n-2)-H(n))/2, n>1, where H(n) is the n-th harmonic number. [Gary Detlefs, Oct 04 2011]
E.g.f.: x + 1/(1-x) - x*log(1-x) = x^2/G(0)/2 where G(k) = 1 + (k+2)/(x - x*(k+1)/(x + k + 1 - x^4/(x^3 +(k+2)*(k+3)/G(k+1)))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Jul 06 2012
G.f.: G(0) where G(k) = 1 - x/(1 + x/(1 - x - (k+1)/( k+1 - x/Q))); (continued fraction, 3rd kind, 4-step). - Sergei N. Gladkovskii, Jul 28 2012
For n >= 1, a(n) = A276940(n)/n. - Antti Karttunen, Sep 24 2016
Sum_{n>=2} 1/a(n) = A306770. - Amiram Eldar, Nov 19 2020

Extensions

Simpler definition from Miklos Kristof, Jun 16 2005
More terms from Antti Karttunen, Sep 24 2016

A108217 a(0) = 1, a(1) = 1, a(n) = n! + (n-2)! for n >= 2.

Original entry on oeis.org

1, 1, 3, 7, 26, 126, 744, 5160, 41040, 367920, 3669120, 40279680, 482630400, 6266937600, 87657292800, 1313901388800, 21009968179200, 356995102464000, 6423296495616000, 122000787836928000, 2439304381882368000, 51212587272118272000, 1126433629785784320000
Offset: 0

Views

Author

Miklos Kristof, following a suggestion from Peter Boros, (borospet(AT)freemail.hu), Jun 16 2005

Keywords

Comments

In factorial base representation (A007623) the terms of this sequence look as: 1, 1, 11, 101, 1010, 10100, 101000, ... From a(3)=7 onward each term begins always with "101", which is then followed by n-3 zeros. - Antti Karttunen, Sep 23 2016

Examples

			a(6) = 6!+4! = 720+24 = 744.
		

Crossrefs

Row 5 of A276955, from term a(3)=7 onward.

Programs

Formula

For n >= 2, a(n) = A002061(n) * (n-2)! - Antti Karttunen, Sep 23 2016
E.g.f.: x + (1-x)*log(1-x) + 1/(1-x). - Andrew Howroyd, May 09 2021

Extensions

Corrected by Georg Fischer, May 09 2021

A351580 a(n) is the number of multisets of size n-1 consisting of permutations of n elements.

Original entry on oeis.org

1, 2, 21, 2600, 9078630, 1634935320144, 22831938997720867560, 34390564970975286088924022400, 7457911916650283082000186530740981347120, 300682790088737748950725540713718365319268411170195200, 2830053444386286847574443631356044745870287426798365860653876609636480
Offset: 1

Views

Author

Dan Eilers, Feb 13 2022

Keywords

Comments

a(n) is the number of reduced men's ranking tables in the stable marriage problem of order n. In the SMP (as noted in A351409), relabeling men or women has no effect on the number of stable matchings. So the women can be relabeled to normalize the order of man #1's rankings (with woman #1 as his first choice and woman n as his last choice), and then the men except man #1 can be relabeled to normalize the lexicographic order of those men's rankings. Since man #1's rankings end up fixed in natural order, they do not contribute to the number of possibilities, leaving n! multichoose (n-1) ways to arrange the rankings of the other n-1 men.
The number of unreduced men's ranking tables is given by A036740. Relabeling just the women reduces this to A134366. Alternately, relabeling just the men reduces A036740 to A344690. Relabeling both men and women reduces the men's relabeling reduction, A344690, by a factor of (n!+n-1)/n to a(n).
It might be tempting to try to reduce A344690 by a factor of n!, but that doesn't work because not all of man #1's rankings are equally likely after relabeling all the men to give man #1 the lexicographically least rankings.
There is room for further relabeling reduction from a(n), given by A263921. The reduction from a(n) to A263921 is analogous to the reduction from reduced latin squares, A000315, to A123234.
Each of the a(n) reduced men's ranking tables can be combined with the A036740 possible unreduced women's ranking tables to form complete instances, but these instances have more possibilities than A351409. For example, a(3)*A036740(3)=21*216=4536 > A351409(3)=3888. However, fewer possibilities result from using A263921 in place of a(n), although the men's ranking tables of A263921 may not be as straightforward to generate. With A263921(3)=10, 10*216=2160 < 3888.

Examples

			Starting with the following men's ranking table of order 3, where row k represents man k's rankings, the 1 in the 2nd position of row 3 means that man #3 ranks woman #2 as his 1st choice.
  213
  321
  213
Step 1: reorder columns so row 1 is in natural order:
  123
  231
  123
Step 2: reorder rows 2 to n so rows are in lexical order:
  123
  123
  231
a(3)=21 because there are 1+2+3+4+5+6 = 21 possibilities for the last two rows in lexical order, with 3!=6 possible permutations for each row.
The 21 tables for a(3) are the following:
  123   123   123   123   123   123   123
  123   123   123   123   123   123   132
  123   132   213   231   312   321   132
.
  123   123   123   123   123   123   123
  132   132   132   132   213   213   213
  213   231   312   321   213   231   312
.
  123   123   123   123   123   123   123
  213   231   231   231   312   312   321
  321   231   312   321   312   321   321
		

Crossrefs

Programs

  • Mathematica
    Table[Binomial[n!+n-2,n-1],{n,15}] (* Harvey P. Dale, Jun 02 2023 *)
  • PARI
    a(n) = binomial(n! + n - 2, n - 1) \\ Andrew Howroyd, Feb 13 2022

Formula

a(n) = binomial(n! + n - 2, n - 1).
a(n) = n*A344690(n)/A030495(n-1).
a(n) = A344690*n/(n! + n - 1).
a(n) = A071919(n-1,n!). - Alois P. Heinz, Feb 16 2022

Extensions

Erroneous Mathematica program deleted by N. J. A. Sloane, Jun 02 2023
Showing 1-5 of 5 results.