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

A163270 First column in matrix inverse of (A047999*A154990).

Original entry on oeis.org

1, 1, 1, 3, 1, 3, 3, 13, 1, 3, 3, 13, 3, 13, 13, 75, 1, 3, 3, 13, 3, 13, 13, 75, 3, 13, 13, 75, 13, 75, 75, 541
Offset: 1

Views

Author

Mats Granvik, Jul 24 2009

Keywords

Examples

			First column in the table:
1,
1,1,
1,0,1,
3,1,1,1,
1,0,0,0,1,
3,1,0,0,1,1,
3,0,1,0,1,0,1,
13,3,3,1,3,1,1,1,
		

Crossrefs

Cf. It appears that A000670 = A163270(A000079).

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

Original entry on oeis.org

1, 1, 0, -2, -5, -9, -14, -20, -27, -35, -44, -54, -65, -77, -90, -104, -119, -135, -152, -170, -189, -209, -230, -252, -275, -299, -324, -350, -377, -405, -434, -464, -495, -527, -560, -594, -629, -665, -702, -740, -779, -819, -860, -902, -945, -989, -1034, -1080, -1127, -1175, -1224, -1274, -1325, -1377
Offset: 0

Views

Author

Paul Barry, Mar 01 2003

Keywords

Comments

Coefficient of x in the polynomial C(n,0)+C(n+1,1)x+C(n+2,2)x(x-1)/2.
Equals A154990 * [1,2,3,...]. - Gary W. Adamson & Mats Granvik, Jan 19 2009
a(n) is essentially the case 1 of the polygonal numbers. The polygonal numbers are defined as P_k(n) = Sum_{i=1..n} ((k-2)*i-(k-3)). Thus P_1(n) = n*(3-n)/2 and a(n) = P_1(n+1). See A005563 for the case k=0. - Peter Luschny, Jul 08 2011
This is the case k=-1 of the formula (k*m*(m+1)-(-1)^k+1)/2. See similar sequences listed in A262221. - Bruno Berselli, Sep 17 2015

Examples

			a(5) = 6-(1+2+3+4+5). - _Stanislav Sykora_, Feb 19 2014
		

Crossrefs

Programs

  • Magma
    [(n+1)*(2-n)/2: n in [0..80]]; // Vincenzo Librandi, Jul 08 2011
    
  • Maple
    G(x):=exp(x)*(x-x^2/2): f[0]:=G(x): for n from 1 to 54 do f[n]:=diff(f[n-1],x) od: x:=0: seq(f[n],n=1..54 ); # Zerinvary Lajos, Apr 05 2009
  • Mathematica
    FoldList[#1 - #2 &, 1, Range[0, 44]] (* Arkadiusz Wesolowski, May 26 2013 *)
    LinearRecurrence[{3,-3,1},{1,1,0},60] (* Harvey P. Dale, Nov 29 2019 *)
  • PARI
    a(n)=(n+1)*(2-n)/2;
    
  • SageMath
    def A080956(n): return (2-n)*(n+1)//2 # G. C. Greubel, May 08 2025

Formula

a(n) = 2*(C(n+1, 1)-C(n+2, 2)) = (n+1)*(2-n)/2.
G.f.: (1-2*x)/(1-x)^3. - R. J. Mathar, Jun 11 2009
If we define f(n,i,a) = Sum_{k=0..n-i} (binomial(n,k)*stirling1(n-k,i)*Product_{j=0..k-1} (-a-j)), then a(n) = f(n,n-1,2), for n>=3. - Milan Janjic, Dec 20 2008
E.g.f.: exp(x)*(1-x^2/2). - Zerinvary Lajos, Apr 05 2009, R. J. Mathar, Jun 11 2009
a(n) = - A214292(n,1) for n > 0. - Reinhard Zumkeller, Jul 12 2012
Recurrence: a(0)=1, a(n+1) = a(n) - n. Also a(n)=(n+1)-Sum[k=1..n](k). Also a(n) = A000027(n+1) - A000217(n). Also, for n>1, a(n) = - A000096(n-2). - Stanislav Sykora, Feb 19 2014
Sum_{n>=3} 1/a(n) = -11/9. - Amiram Eldar, Sep 26 2022

Extensions

Lajos e.g.f. adapted to offset zero by R. J. Mathar, Jun 11 2009

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

A145839 Number of 3-compositions of n.

Original entry on oeis.org

1, 3, 15, 73, 354, 1716, 8318, 40320, 195444, 947380, 4592256, 22260144, 107902088, 523036176, 2535324816, 12289536016, 59571339552, 288761470848, 1399719859808, 6784893012864, 32888561860032, 159421452802624, 772767131681280, 3745851196992000
Offset: 0

Author

Simone Rinaldi (rinaldi(AT)unisi.it), Oct 21 2008

Keywords

Comments

A 3-composition of n is a matrix with three rows, such that each column has at least one nonzero element and whose elements sum up to n.
Matrix inverse of (A000217(A004736)*A154990). - Mats Granvik, Jan 19 2009
(1 +3*x +15*x^2 +73*x^3 + ...) = 1/(1 -3*x -6*x^2 -10*x^3 -15*x^4 - ...). - Gary W. Adamson, Jul 27 2009
For n>1, a(n) is the number of generalized compositions of n-1 when there are i^2/2 +3i/2 +1 different types of i, (i=1,2,...). - Milan Janjic, Sep 24 2010

References

  • G. Louchard, Matrix compositions: a probabilistic approach, Proceedings of GASCom and Bijective Combinatorics 2008, Bibbiena, Italy, pp. 159-170.

Crossrefs

Cf. A003480 (2-compositions), A145840 (4-compositions), A145841 (5-compositions).
Column k=3 of A261780.

Programs

  • Magma
    I:=[3,15,73]; [1] cat [n le 3 select I[n] else 6*Self(n-1) - 6*Self(n-2) + 2*Self(n-3): n in [1..30]]; // G. C. Greubel, Mar 07 2021
  • Maple
    a:= proc(n) option remember; `if`(n=0, 1,
          add(a(n-j)*binomial(j+2, 2), j=1..n))
        end:
    seq(a(n), n=0..25);  # Alois P. Heinz, Sep 01 2015
  • Mathematica
    Table[Sum[Binomial[n+3*k-1,n]/2^(k+1),{k,0,Infinity}],{n,0,20}] (* Vaclav Kotesovec, Dec 31 2013 *)
    a[n_]:= a[n]= If[n==0, 1, Sum[Binomial[n-j+2, 2]*a[j], {j,0,n-1}]]; Table[a[n], {n, 0, 20}] (* G. C. Greubel, Mar 07 2021 *)
  • Sage
    @CachedFunction
    def a(n):
        if n==0: return 1
        else: return sum( binomial(n-j+2,2)*a(j) for j in (0..n-1))
    [a(n) for n in (0..25)] # G. C. Greubel, Mar 07 2021
    

Formula

a(n+3) = 6*a(n+2) - 6*a(n+1) + 2*a(n).
G.f.: (1-x)^3/(2*(1-x)^3 - 1).
a(n) = Sum_{k>=0} C(n+3*k-1,n) / 2^(k+1). - Vaclav Kotesovec, Dec 31 2013
a(n) = Sum_{j=0..n-1} binomial(n-j+2, 2)*a(j) with a(0) = 1. - G. C. Greubel, Mar 07 2021

Extensions

Offset corrected by Alois P. Heinz, Aug 31 2015

A155038 Triangle read by rows: T(n,k) is the number of compositions of n with first part k.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 8, 4, 2, 1, 1, 16, 8, 4, 2, 1, 1, 32, 16, 8, 4, 2, 1, 1, 64, 32, 16, 8, 4, 2, 1, 1, 128, 64, 32, 16, 8, 4, 2, 1, 1, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 1, 2048, 1024, 512
Offset: 1

Author

Mats Granvik, Jan 19 2009

Keywords

Comments

Previous name was: Matrix inverse of A154990.
Apart from first term essentially the same as A057728.
A011782 appears in the columns.
Riordan array ((1-x)/(1-2x), x). - Philippe Deléham, Jan 24 2010
Indexing the triangle from n=0 and k=0, T(n,k) is the number of binary words of length n that begin with a run of exactly k 0's. O.g.f.: 1/((1-y*x)*(1-x/(1-x))). - Geoffrey Critzer, Feb 15 2012

Examples

			T(5,2) = 4 because the compositions of 5 with first part 2 are: [2,3], [2,2,1], [2,1,2], and [2,1,1,1]. - _Emeric Deutsch_, Jan 12 2018
Table begins:
   1,
   1,  1,
   2,  1,  1,
   4,  2,  1,  1,
   8,  4,  2,  1,  1,
  16,  8,  4,  2,  1,  1,
  32, 16,  8,  4,  2,  1,  1,
  64, 32, 16,  8,  4,  2,  1,  1,
Production matrix begins:
  1, 1
  1, 0, 1
  1, 0, 0, 1
  1, 0, 0, 0, 1
  1, 0, 0, 0, 0, 1
  1, 0, 0, 0, 0, 0, 1
  1, 0, 0, 0, 0, 0, 0, 1
  1, 0, 0, 0, 0, 0, 0, 0, 1
  ... - _Philippe Deléham_, Oct 04 2014
		

Crossrefs

Programs

  • Haskell
    a155038 n k = a155038_tabl !! (n-1) !! (k-1)
    a155038_row n = a155038_tabl !! (n-1)
    a155038_tabl = iterate
       (\row -> zipWith (+) (row ++ [0]) (init row ++ [0,1])) [1]
    -- Reinhard Zumkeller, Aug 08 2013
  • Maple
    T := proc(n, k) if k = n then 1 elif k < n then 2^(n-k-1) else 0 end if end proc: for n to 13 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form - Emeric Deutsch, Jan 12 2018
    G:= (1-2*x+t*x^2)/((1-2*x)*(1-t*x)): Gser := simplify(series(G, x = 0, 15)): for n to 14 do P[n] := coeff(Gser, x, n) end do: for n to 14 do seq(coeff(P[n], t, j), j = 1 .. n) end do; # yields sequence in triangular form - Emeric Deutsch, Jan 19 2018
  • Mathematica
    nn = 15; a = 1/(1 - y x); f[list_] := Select[list, # > 0 &];Map[f, CoefficientList[Series[ a/(1 - x/(1 - x)), {x, 0, nn}], {x, y}]] // Flatten (* Geoffrey Critzer, Feb 15 2012 *)

Formula

T(j,k) = A011782(j-k), j>=1, k>=1. - Omar E. Pol, Feb 14 2013
T(n,k) = 2^{n-k-1} if kn. - Emeric Deutsch, Jan 12 2018
G.f.: G(t,x) = (1-2*x+t*x^2)/((1-2*x)*(1-t*x)). - Emeric Deutsch, Jan 19 2018

Extensions

New name from Joerg Arndt, May 04 2014

A155031 Triangle T(n, k) = 0 if n==0 (mod k) otherwise -1 with T(n, n) = 1 and T(n, 0) = 0, read by rows.

Original entry on oeis.org

1, 0, 1, 0, -1, 1, 0, 0, -1, 1, 0, -1, -1, -1, 1, 0, 0, 0, -1, -1, 1, 0, -1, -1, -1, -1, -1, 1, 0, 0, -1, 0, -1, -1, -1, 1, 0, -1, 0, -1, -1, -1, -1, -1, 1, 0, 0, -1, -1, 0, -1, -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1
Offset: 1

Author

Mats Granvik, Jan 19 2009

Keywords

Examples

			Table begins:
  1;
  0,  1;
  0, -1,  1;
  0,  0, -1,  1;
  0, -1, -1, -1,  1;
  0,  0,  0, -1, -1,  1;
  0, -1, -1, -1, -1, -1,  1;
  0,  0, -1,  0, -1, -1, -1,  1;
  0, -1,  0, -1, -1, -1, -1, -1, 1;
		

Crossrefs

Programs

  • Magma
    [k eq n select 1 else (k eq 1 or n mod k eq 0) select 0 else -1: k in [1..n], n in [1..12]]; // G. C. Greubel, Mar 08 2021
  • Mathematica
    T[n_, k_]:= If[k==n, 1, If[k==1 || Mod[n, k]==0, 0, -1]];
    Table[T[n, k], {n, 12}, {k, n}] //Flatten (* G. C. Greubel, Mar 08 2021 *)
  • Sage
    flatten([[1 if k==n else 0 if (k==1 or n%k==0) else -1 for k in [1..n]] for n in [1..12]]) # G. C. Greubel, Mar 08 2021
    

Formula

T(n, k) = A154990(n, k) * A155029(n, k).
T(n, k) = 0 if n==0 (mod k) otherwise -1 with T(n, n) = 1 and T(n, 0) = 0.

A174557 Triangle T(n, k) = -floor(n/k) with T(n, n) = 1, read by rows.

Original entry on oeis.org

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

Author

Mats Granvik, Paul D. Hanna, Mar 22 2010

Keywords

Examples

			Table begins:
    1;
   -2,  1;
   -3, -1,  1;
   -4, -2, -1,  1;
   -5, -2, -1, -1,  1;
   -6, -3, -2, -1, -1,  1;
   -7, -3, -2, -1, -1, -1,  1;
   -8, -4, -2, -2, -1, -1, -1,  1;
   -9, -4, -3, -2, -1, -1, -1, -1,  1;
  -10, -5, -3, -2, -2, -1, -1, -1, -1, 1;
		

Crossrefs

Programs

  • Magma
    [k eq n select 1 else -Floor(n/k): k in [1..n], n in [1..12]]; // G. C. Greubel, Mar 06 2021
  • Mathematica
    Table[If[k==n, 1, -Floor[n/k]], {n,12}, {k,n}]//Flatten (* G. C. Greubel, Mar 06 2021 *)
  • Sage
    flatten([[1 if k==n else -(n//k) for k in [1..n]] for n in [1..12]]) # G. C. Greubel, Mar 06 2021
    

Formula

T(n, k) = A010766(n, k)*A154990(n, k).
T(n, k) = -floor(n/k) with T(n, n) = 1. - G. C. Greubel, Mar 06 2021
Showing 1-7 of 7 results.