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-6 of 6 results.

A005425 a(n) = 2*a(n-1) + (n-1)*a(n-2).

Original entry on oeis.org

1, 2, 5, 14, 43, 142, 499, 1850, 7193, 29186, 123109, 538078, 2430355, 11317646, 54229907, 266906858, 1347262321, 6965034370, 36833528197, 199037675054, 1097912385851, 6176578272782, 35409316648435, 206703355298074, 1227820993510153, 7416522514174082
Offset: 0

Views

Author

Keywords

Comments

Switchboard problem with n subscribers, where a subscriber who is not talking can be of either of two sexes. Subscribers who are talking cannot be distinguished by sex. See also A000085. - Karol A. Penson, Apr 15 2004
John W. Layman observes that computationally this agrees with the binomial transform of A000085.
Number of self-inverse partial permutations.
Number of '12-3 and 214-3'-avoiding permutations.
Number of matchings of the corona K'(n) of the complete graph K(n) and the complete graph K(1); in other words, K'(n) is the graph constructed from K(n) by adding for each vertex v a new vertex v' and the edge vv'. Example: a(3)=14 because in the graph with vertex set {A,B,C,a,b,c} and edge set {AB,AC,BC,Aa,Bb,Cc} we have the following matchings: (i) the empty set (1); (ii) the edges as singletons (6); (iii) {Aa,BC},{Bb,AC},{Cc,AB},{Aa,Bb},{Aa,Cc}, {Bb,Cc} (6); (iv) {Aa,Bb,Cc} (1). Row sums of A100862. - Emeric Deutsch, Jan 10 2005
Consider finite sequences of positive integers of length n with b(1)=1 and with the constraint that b(m) <= max_{0A111062. - Franklin T. Adams-Watters, Dec 21 2005, corrected Dec 31 2014
Number of n X n symmetric binary matrices with no row sum greater than 1. - R. H. Hardin, Jun 13 2008
Polynomials in A099174 evaluated at x=2 (see also formula by Deutsch below). - Johannes W. Meijer, Feb 04 2010
Equals eigensequence of triangle A128227. Example: a(5) = 142 = (1, 1, 2, 5, 14, 43) dot (1, 2, 3, 4, 5, 1) = (1 + 2 + 6 + 20 + 70 + 43); where (1, 2, 3, 4, 5, 1) = row 5 of triangle A128227. - Gary W. Adamson, Aug 27 2010
Number of words [d(1), d(2), ..., d(n)] where d(k) is either =0, or =k (a fixed point), or the only value repeating a previous fixed point, see example. - Joerg Arndt, Apr 18 2014
From Robert A. Russell, Apr 28 2018: (Start)
Stirling transform of this sequence is A002872;
Stirling transform of A005425(n-1) is A080337. (End)
Number of congruence orbits of upper-triangular n X n matrices on symmetric matrices, or the number of Borel orbits in largest sect of the type CI symmetric space Sp_{2n}(C)/GL_n(C). - Aram Bingham, Oct 10 2019
For a refined enumeration of the switchboard scenario presented by Penson above and in Donaghey and its relation to perfect matchings of simplices and an operator calculus, see A344678. - Tom Copeland, May 29 2021
Write [n] for {1, ..., n} and [n]^(k) for k-tuples without repeated entries. Then C [n]^(k) is naturally a complex S_n-representation, whose length is a(k) provided that n >= 2k. a(k) also gives the length of the countable dimensional Sym(N)-representation C N^(k), as remarked by Sam and Snowden (see link). - Jingjie Yang, Dec 28 2023

Examples

			From _Joerg Arndt_, Apr 18 2014: (Start)
The a(3) = 14 words [d(1), d(2), d(3)] where d(k) is either =0, or =k (a fixed point), or the only value repeating a previous fixed point are (dots for zeros):
# :    word        partial involution
01:  [ . . . ]    ()
02:  [ . . 3 ]    (3)
03:  [ . 2 . ]    (2)
04:  [ . 2 2 ]    (2 3)
05:  [ . 2 3 ]    (2) (3)
06:  [ 1 . . ]    (1)
07:  [ 1 . 1 ]    (1 3)
08:  [ 1 . 3 ]    (1) (3)
09:  [ 1 1 . ]    (1 2)
10:  [ 1 1 3 ]    (1 2) (3)
11:  [ 1 2 . ]    (1) (2)
12:  [ 1 2 1 ]    (1 3) (2)
13:  [ 1 2 2 ]    (1) (2 3)
14:  [ 1 2 3 ]    (1) (2) (3)
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Bisections give A093620, A100510.
Row sums of A344678.

Programs

  • Haskell
    a005425 n = a005425_list !! n
    a005425_list = 1 : 2 : zipWith (+)
       (map (* 2) (tail a005425_list)) (zipWith (*) [1..] a005425_list)
    -- Reinhard Zumkeller, Dec 18 2011
    
  • Magma
    a:=[2,5];[1] cat [n le 2 select a[n] else 2*Self(n-1) + (n-1)*Self(n-2):n in [1..30]]; // Marius A. Burtea, Oct 10 2019
    
  • Maple
    with(orthopoly): seq((-I/sqrt(2))^n*H(n,I*sqrt(2)),n=0..25);
  • Mathematica
    a[0] = 1; a[1] = 2; a[n_]:= 2a[n-1] + (n-1)*a[n-2]; Table[ a[n], {n, 0, 25}] (* or *)
    Range[0, 25]!CoefficientList[Series[Exp[2 x + x^2/2], {x, 0, 25}], x] (* or *)
    f[n_] := Sum[2^(n - 3k)n!/((n - 2k)!k!), {k, 0, n}]; Table[ f[n], {n, 0, 25}] (* or *)
    Table[(-I/Sqrt[2])^n*HermiteH[n, I*Sqrt[2]], {n, 0, 25}] (* Robert G. Wilson v, Nov 04 2005 *)
    RecurrenceTable[{a[0]==1,a[1]==2,a[n]==2a[n-1]+(n-1)a[n-2]},a,{n,30}] (* Harvey P. Dale, Sep 30 2015 *)
    a[n_] := 2^(n/2) Exp[- I n Pi/2] HypergeometricU[-n/2, 1/2, -2];
    Table[a[n], {n, 0, 22}] (* Peter Luschny, May 30 2021 *)
  • Maxima
    makelist((%i/sqrt(2))^n*hermite(n,-%i*sqrt(2)),n,0,12); /* Emanuele Munarini, Mar 02 2016 */
    
  • PARI
    A005425(n)=sum(k=0,n\2,2^(n-3*k)*n!/(n-2*k)!/k!) \\ M. F. Hasler, Jan 13 2012
    
  • SageMath
    [(-i/sqrt(2))^n*hermite(n, i*sqrt(2)) for n in range(41)] # G. C. Greubel, Nov 19 2022

Formula

E.g.f.: exp( 2*x + x^2/2 ).
a(n) = A027412(n+1)/2. - N. J. A. Sloane, Sep 13 2003
a(n) = Sum_{k=0..n} binomial(n, k)*A000085(n-k). - Philippe Deléham, Mar 07 2004
a(n) = (-i/sqrt(2))^n*H(n, i*sqrt(2)), where H(n, x) is the n-th Hermite polynomial and i = sqrt(-1). - Emeric Deutsch, Nov 24 2004
a(n) = Sum_{k=0..floor(n/2)} 2^{n-3*k}*n!/((n-2*k)!*k!). - Huajun Huang (hua_jun(AT)hotmail.com), Oct 10 2005
a(n) = (1/sqrt(2*Pi))*Integral_{x=-infinity..infinity} exp(-x^2/2)*(x+2)^n. - Groux Roland, Mar 14 2011
G.f.: 1/(1-2x-x^2/(1-2x-2x^2/(1-2x-3x^2/(1-2x-4x^2/(1-... (continued fraction).
E.g.f.: G(0) where G(k) = 1 + x*(4+x)/(4*k + 2 - x*(4+x)*(4*k+2)/(x*(4+x) + 4*(k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Dec 17 2011
a(n) ~ exp(2*sqrt(n) - n/2 - 1)*n^(n/2)/sqrt(2). - Vaclav Kotesovec, Oct 08 2012
a(n) = 2^(n/2)*exp(-i*n*Pi/2)*KummerU(-n/2, 1/2, -2). - Peter Luschny, May 30 2021

Extensions

Recurrence and formula corrected by Olivier Gérard, Oct 15 1997

A128229 A natural number transform, inverse of signed A094587.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, 0, 0, 3, 1, 0, 0, 0, 4, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 0, 6, 1, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 0, 0, 0, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 1
Offset: 1

Views

Author

Gary W. Adamson, Feb 19 2007

Keywords

Comments

Signed version of the transform (with -1, -2, -3, ... in the subdiagonal) gives A094587 having row sums A000522: (1, 2, 5, 16, 65, 236, ...). Unsigned inverse gives signed A094587 (with alternate signs); giving row sums = a signed variation of A094587 as follows: (1, 0, 1, -2, 9, -44, 265, -1854, ...). Binomial transform of the triangle = A093375.
Eigensequence of the triangle = A000085 starting (1, 2, 4, 10, 26, 76, ...). - Gary W. Adamson, Dec 29 2008

Examples

			First few rows of the triangle are:
1;
1, 1;
0, 2, 1;
0, 0, 3, 1;
0, 0, 0, 4, 1;
0, 0, 0, 0, 5, 1;
0, 0, 0, 0, 0, 6, 1;
0, 0, 0, 0, 0, 0, 7, 1;
...
		

Crossrefs

Programs

  • Mathematica
    a128229[n_] := Table[Which[r==q, 1, r-1==q, q, True, 0], {r, 1, n}, {q, 1, r}]
    Flatten[a128229[13]] (* data *)
    TableForm[a128229[8]] (* triangle *)
    (* Hartmut F. W. Hoft, Jun 10 2017 *)
  • Python
    def T(n, k): return 1 if n==k else n - 1 if k==n - 1 else 0
    for n in range(1, 11): print([T(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, Jun 10 2017

Formula

Infinite lower triangular matrix with (1,1,1,...) in the main diagonal and (1,2,3,...) in the subdiagonal.
T(n,n)=1, T(n,n-1)=n-1 and T(n,k)=0 for 1<=k<=n, 1<=n. - Hartmut F. W. Hoft, Jun 10 2017

A144328 A002260 preceded by a column of 1's: a (1, 1, 2, 3, 4, 5, ...) crescendo triangle by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 3, 4, 1, 1, 2, 3, 4, 5, 1, 1, 2, 3, 4, 5, 6, 1, 1, 2, 3, 4, 5, 6, 7, 1, 1, 2, 3, 4, 5, 6, 7, 8, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Offset: 1

Views

Author

Gary W. Adamson, Sep 18 2008

Keywords

Comments

Row sums = A000124.
Eigensequence of the triangle = A000142, the factorials.
The triangle as an infinite lower triangular matrix * [1,2,3,...] = A064999.
Generated from A128227 by rotating each row by one position to the right. - R. J. Mathar, Sep 25 2008
A sequence B is called a reluctant sequence of sequence A, if B is triangle array read by rows: row number k coincides with first k elements of the sequence A. Sequence A144328 is the reluctant sequence of A028310 (1 followed by the natural numbers). - Boris Putievskiy, Dec 12 2012
If offset were changed to 0, a(n) would equal the
Let S_n be the set of partitions of n into distinct parts where the number of parts is maximal for that n. For example, for n=6, the set S_6 consists of just one such partition: S_6={1,2,3}. Similarly, for n=7, S_7={1,2,4}, But for n=8, S_8 will contain two partitions S_8= { {1,2,5}, {1,3,4} }. Then |S(n)| = a(n+1). Cf. A178702. - David S. Newman and Benoit Jubin, Dec 13 2010

Examples

			First few rows of the triangle:
  1;
  1, 1;
  1, 1, 2;
  1, 1, 2, 3;
  1, 1, 2, 3, 4;
  1, 1, 2, 3, 4, 5;
  ...
		

Crossrefs

Programs

  • Haskell
    a144328 n k = a144328_tabl !! (n-1) !! (k-1)
    a144328_row n = a144328_tabl !! (n-1)
    a144328_tabl = [1] : map (\xs@(x:_) -> x : xs) a002260_tabl
    -- Reinhard Zumkeller, Apr 29 2015
    
  • Mathematica
    Flatten[Table[Join[{1},Range[n]],{n,0,11}]] (* Harvey P. Dale, Aug 10 2013 *)
  • Python
    from math import comb, isqrt
    def A144328(n): return n-comb((m:=isqrt(k:=n<<1))+(k>m*(m+1)),2)-(comb(isqrt(n-1<<1)+1,2)!=n-1) # Chai Wah Wu, Nov 08 2024

Formula

Triangle A002260 (natural numbers crescendo triangle) preceded by a column of 1's, = a (1, 1, 2, 3, 4, 5, ...) crescendo triangle by rows.
a(n) = A028310(m-1), where m = n-t*(t+1)/2, t = floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Dec 13 2012
a(n) = A002260(n)+A010054(n-1)-1. - Chai Wah Wu, Nov 08 2024

A092582 Triangle read by rows: T(n,k) is the number of permutations p of [n] having length of first run equal to k.

Original entry on oeis.org

1, 1, 1, 3, 2, 1, 12, 8, 3, 1, 60, 40, 15, 4, 1, 360, 240, 90, 24, 5, 1, 2520, 1680, 630, 168, 35, 6, 1, 20160, 13440, 5040, 1344, 280, 48, 7, 1, 181440, 120960, 45360, 12096, 2520, 432, 63, 8, 1, 1814400, 1209600, 453600, 120960, 25200, 4320, 630, 80, 9, 1
Offset: 1

Views

Author

Emeric Deutsch and Warren P. Johnson (wjohnson(AT)bates.edu), Apr 10 2004

Keywords

Comments

Row sums are the factorial numbers (A000142). First column is A001710.
T(n,k) = number of permutations of [n] in which 1,2,...,k is a subsequence but 1,2,...,k,k+1 is not. Example: T(4,2)=8 because 1324, 1342, 1432, 4132, 3124, 3142, 3412 and 4312, are the only permutations of [4] in which 12 is a subsequence but 123 is not. - Emeric Deutsch, Nov 12 2004
T(n,k) is the number of deco polyominoes of height n with k cells in the last column. (A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column). - Emeric Deutsch, Jan 06 2005
T(n,k) is the number of permutations p of [n] for which the smallest i such that p(i)Emeric Deutsch, Feb 23 2008
Adding columns 2,4,6,... one obtains the derangement numbers 0,1,2,9,44,... (A000166). See the Bona reference (p. 118, Exercises 41,42). - Emeric Deutsch, Feb 23 2008
Matrix inverse of A128227*A154990. - Mats Granvik, Feb 08 2009
Differences in the columns of A173333 which counts the n-permutations with an initial ascending run of length at least k. - Geoffrey Critzer, Jun 18 2017
The triangle with each row reversed is A130477. - Michael Somos, Jun 25 2017

Examples

			T(4,3) = 3 because 1243, 1342 and 2341 are the only permutations of [4] having length of first run equal to 3.
     1;
     1,    1;
     3,    2,   1;
    12,    8,   3,   1;
    60,   40,  15,   4,  1;
   360,  240,  90,  24,  5,  1;
  2520, 1680, 630, 168, 35,  6,  1;
  ...
		

References

  • M. Bona, Combinatorics of Permutations, Chapman&Hall/CRC, Boca Raton, Florida, 2004.

Crossrefs

Programs

  • GAP
    Flat(List([1..11],n->Concatenation([1],List([1..n-1],k->Factorial(n)*k/Factorial(k+1))))); # Muniru A Asiru, Jun 10 2018
    
  • Magma
    A092582:= func< n,k | k eq n select 1 else k*Factorial(n)/Factorial(k+1) >;
    [A092582(n,k): k in [1..n], n in [1..12]]; // G. C. Greubel, Sep 06 2022
    
  • Mathematica
    Drop[Drop[Abs[Map[Select[#, # < 0 &] &, Map[Differences, nn = 10; Range[0, nn]! CoefficientList[Series[(Exp[y x] - 1)/(1 - x), {x, 0, nn}], {x, y}]]]], 1], -1] // Grid (* Geoffrey Critzer, Jun 18 2017 *)
  • PARI
    {T(n, k) = if( n<1 || k>n, 0, k==n, 1, n! * k /(k+1)!)}; /* Michael Somos, Jun 25 2017 */
    
  • SageMath
    def A092582(n,k): return 1 if (k==n) else k*factorial(n)/factorial(k+1)
    flatten([[A092582(n,k) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Sep 06 2022

Formula

T(n, k) = n!*k/(k+1)! for k
Inverse of:
1;
-1, 1;
-1, -2, 1;
-1, -2, -3, 1;
-1, -2, -3, -4, 1;
... where A002260 = (1; 1,2; 1,2,3; ...). - Gary W. Adamson, Feb 22 2012
T(2n,n) = A092956(n-1) for n>0. - Alois P. Heinz, Jun 19 2017
From Alois P. Heinz, Dec 17 2021: (Start)
Sum_{k=1..n} k * T(n,k) = A002627(n).
|Sum_{k=1..n} (-1)^k * T(n,k)| = A055596(n) for n>=1. (End)
From G. C. Greubel, Sep 06 2022: (Start)
T(n, 1) = A001710(n).
T(n, 2) = 2*A001715(n) + [n=2]/3, n >= 2.
T(n, 3) = 3*A001720(n) + [n=3]/4, n >= 3.
T(n, 4) = 4*A001725(n) + [n=4]/5, n >= 4.
T(n, n-1) = A000027(n-1).
T(n, n-2) = A005563(n-1), n >= 3. (End)
Sum_{k=0..n} (k+1) * T(n,k) = A000522(n). - Alois P. Heinz, Apr 28 2023

A128228 A128229 * A002260.

Original entry on oeis.org

1, 2, 2, 3, 6, 3, 4, 8, 12, 4, 5, 10, 15, 20, 5, 6, 12, 18, 24, 30, 6, 7, 14, 21, 28, 35, 42, 7, 8, 16, 24, 32, 40, 48, 56, 8, 9, 18, 27, 36, 45, 54, 63, 72, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 10
Offset: 1

Author

Gary W. Adamson, Feb 19 2007

Keywords

Comments

Row sums = A006000: (1, 4, 12, 28, 55, 96, 154,...).

Examples

			First few rows of the triangle are:
1;
2, 2;
3, 6, 3;
4, 8, 12, 4;
5, 10, 15, 20, 5;
6, 12, 18, 24, 30, 6;
7, 14, 21, 28, 35, 42, 7;
...
		

Crossrefs

Programs

  • Mathematica
    (* first n rows of the triangle *)
    a128228[n_] := Table[If[r==q, r, q r], {r, 1, n}, {q, 1, r}]
    Flatten[a128228[10]] (* data *)
    TableForm[a128228[7]] (* triangle *)
    (* Hartmut F. W. Hoft, Jun 10 2017 *)

Formula

A128229 * A002260 as infinite lower triangular matrices.
Triangle, n * (each term of A128227).
T(n,k) = k*n if 1<=kHartmut F. W. Hoft, Jun 10 2017

A318274 Triangle read by rows: T(n,k) = n for 0 < k < n and T(n,0) = T(n,n) = 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 4, 4, 1, 1, 5, 5, 5, 5, 1, 1, 6, 6, 6, 6, 6, 1, 1, 7, 7, 7, 7, 7, 7, 1, 1, 8, 8, 8, 8, 8, 8, 8, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, 1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, 1, 12
Offset: 0

Author

Keywords

Comments

T(n,k) is the number of binary bitonic words of length n having k letters 1.
Draw a circular rosette such that all the circles contain the rosette's center. Then T(n,k) is also the number of regions in the plane located inside k circles. In fact, a region can be encoded by a binary bitonic word as follows: label each circle from 1 to n in clockwise or counterclockwise order, then write a length n binary word such that the i-th letter indicates whether the concerned region does (write 1) or does not (write 0) lie inside the i-th circle.
Row n is a partition of A014206(n-1) for n > 0.

Examples

			Triangle begins:
n\k| 0  1  2  3  4  5  6  7  8
---+--------------------------
0  | 1
1  | 1  1
2  | 1  2  1
3  | 1  3  3  1
4  | 1  4  4  4  1
5  | 1  5  5  5  5  1
6  | 1  6  6  6  6  6  1
7  | 1  7  7  7  7  7  7  1
8  | 1  8  8  8  8  8  8  8  1
...
For n = 5, the binary bitonic words are
(k = 0) 00000;
(k = 1) 10000, 01000, 00100, 00010, 00001;
(k = 2) 11000, 01100, 00110, 00011, 10001;
(k = 3) 11100, 01110, 00111, 10011, 11001;
(k = 4) 11110, 01111, 10111, 11011, 11101;
(k = 5) 11111.
		

Crossrefs

Row sums: A014206 preceded by 1.

Programs

  • Mathematica
    Table[If[k == n || k == 0, 1, n], {n, 0, 20}, {k, 0, n}] // Flatten
  • Maxima
    T(n, k) := if k = 0 or k = n then 1 else if k < n then n else 0$
    for n:0 thru 10 do print(makelist(T(n, k), k, 0, n));
    
  • PARI
    T(n,k) = if ((k==0) || (k==n), 1, n);
    tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n, k), ", ")); print); \\ Michel Marcus, Aug 25 2018
    
  • Python
    from math import isqrt
    def A318274(n): return 1 if 0<=(k:=n+1<<1)-(r:=(m:=isqrt(k))*(m+1))<=2 else m-(k<=r) # Chai Wah Wu, Nov 09 2024

Formula

The n-th row are the coefficients in the expansion of 1 + x^n + n*x*(1 - x^(n - 1))/(1 - x), n > 0.
G.f. for column k > 0: (((1 - k)*x^2 - (1 - k)*x + 1)*x^k)/(x - 1)^2.
T(n+1,n-k) - n + k = A128227(n,k).
Showing 1-6 of 6 results.