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.

Previous Showing 11-20 of 38 results. Next

A356185 The difference between number of even and number of odd Grassmannian permutations of size n.

Original entry on oeis.org

1, 1, 0, 1, 0, 3, 2, 9, 8, 23, 22, 53, 52, 115, 114, 241, 240, 495, 494, 1005, 1004, 2027, 2026, 4073, 4072, 8167, 8166, 16357, 16356, 32739, 32738, 65505, 65504, 131039, 131038, 262109, 262108, 524251, 524250, 1048537, 1048536, 2097111, 2097110, 4194261, 4194260
Offset: 0

Views

Author

Per W. Alexandersson, Jul 28 2022

Keywords

Comments

A permutation is Grassmann if it has at most one descent. A closed-form formula was proved by J. B. Gil and J. A. Tomasko.

Examples

			For n=3, 123, 231, 312 are even Grassmann permutations, and 132, 213 are the odd ones. Hence a(3) = 1.
		

Crossrefs

Bisections give: A005803 (even part), A183155 (odd part).

Programs

  • Mathematica
    Table[2^Floor[1 + (n - 1)/2] - n, {n, 1, 80}]

Formula

a(n) = 2^(1+floor((n-1)/2))-n.
From Alois P. Heinz, Jul 28 2022: (Start)
G.f.: -(4*x^3-3*x^2-x+1)/((2*x^2-1)*(x-1)^2).
a(n) = A000325(n) - A233411(n) = A060546(n) - n = 2^ceiling(n/2) - n.
a(n) = A000325(n) - 2*A032085(n) = A000325(n) - 2*A122746(n-2) for n>=2. (End)

A077866 Expansion of (1-x)^(-1)/(1 - x - 2*x^2 + 2*x^3).

Original entry on oeis.org

1, 2, 5, 8, 15, 22, 37, 52, 83, 114, 177, 240, 367, 494, 749, 1004, 1515, 2026, 3049, 4072, 6119, 8166, 12261, 16356, 24547, 32738, 49121, 65504, 98271, 131038, 196573, 262108, 393179, 524250, 786393, 1048536, 1572823, 2097110, 3145685, 4194260, 6291411, 8388562
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

Equals triangle A122196 * [1,2,4,8,16,...]. - Gary W. Adamson, Nov 29 2008
Conjecture: let b(n) be the number of subsets S of {1,2,...,n} having more than one element such that (sum of least two elements of S) = max(S). Then b(0) = b(1) = b(2) = 0 and b(n+3) = a(n) for n >= 0. - Clark Kimberling Sep 27 2022

Examples

			G.f. = 1 + 2*x + 5*x^2 + 8*x^3 + 15*x^4 + 22*x^5 + 37*x^6 + ... - _Michael Somos_, Aug 11 2021
		

Crossrefs

Bisections are A005803 and A050488.
Cf. A052551 (first differences), A122196.

Programs

  • Mathematica
    CoefficientList[Series[(1-x)^(-1)/(1-x-2x^2+2x^3),{x,0,50}],x] (* or *) LinearRecurrence[{2,1,-4,2},{1,2,5,8},50] (* Harvey P. Dale, Feb 16 2013 *)
  • PARI
    Vec((1-x)^(-1)/(1-x-2*x^2+2*x^3)+O(x^99)) \\ Charles R Greathouse IV, Sep 26 2012

Formula

a(n) = 2^(n/2)*(3 + 2*sqrt(2) + (3 - 2*sqrt(2))*(-1)^n) - n - 5. - Paul Barry, Apr 23 2004
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + 2*a(n-4); a(0)=1, a(1)=2, a(2)=5, a(3)=8. - Harvey P. Dale, Feb 16 2013
a(2n) = 3*2^(n+1) - 2(n+1) - 3 = A050488(n+1) and a(2n+1) = 2^(n+3) - 2(n+3) = A005803(n+3). Also, a(2n+1) - a(2n) = 2^(n+1) - 1 = a(2n) - a(2n - 1). - Gregory L. Simay, Feb 07 2021
E.g.f.: 6*cosh(sqrt(2)*x) + 4*sqrt(2)*sinh(sqrt(2)*x) - exp(x)*(5 + x). - Stefano Spezia, Feb 08 2021
G.f.: 1/((1 - x)^2 * (1 - 2*x^2)). - Michael Somos, Aug 11 2021

A130102 E.g.f.: (e^x - x)^2.

Original entry on oeis.org

1, 0, 2, 2, 8, 22, 52, 114, 240, 494, 1004, 2026, 4072, 8166, 16356, 32738, 65504, 131038, 262108, 524250, 1048536, 2097110, 4194260, 8388562, 16777168, 33554382, 67108812, 134217674, 268435400, 536870854, 1073741764, 2147483586
Offset: 0

Views

Author

Paul Barry, May 07 2007

Keywords

Comments

a(n) is the number of length n binary sequences in which no symbol occurs exactly once. (The Rosenthal formula takes 2^n for the total number of binary sequences and subtracts n for each sequence of length n with a single 0 or 1.) - Geoffrey Critzer, Dec 03 2011
From Ambrosio Valencia-Romero, Mar 08 2022: (Start)
a(n), for n > 1, is the number of pure Nash equilibria in the symmetric n-player two-strategy normal-form unanimity game. Let i be a player in set N = {1, 2, 3, ..., n} and s(i) in set S = {0, 1} be i's strategy. Then i's payoff, u(i), in this game is given by:
u(i) = 1 if s(1) = s(2) = ... = s(n-1) = s(n); otherwise, u(i) = 0.
Only two of the a(n) pure equilibria in this unanimity game are strict: s = <0, 0, ..., 0, 0> and s = <1, 1, ..., 1, 1>; these are the diagonal collective strategies where all actors obtain the payoff u(i) = 1.
The other a(n)-2 pure equilibria are weak and produce an individual payoff of u(i) = 0; these correspond to the collective strategy outcomes where more than one and fewer than n-1 individual strategies differ. For instance, for n = 4, the a(4)-2 = 6 weak pure equilibria are <0, 0, 1, 1>, <0, 1, 0, 1>, <0, 1, 1, 0>, <1, 0, 0, 1>, <1, 0, 1, 0>, and <1, 1, 0, 0>. (End)

Examples

			a(4) = 8 because there are 8 sequences on {0,1} such that neither 0 nor 1 occurs exactly once: {0,0,0,0}, {0,0,1,1}, {0,1,0,1}, {0,1,1,0}, {1,0,0,1}, {1,0,1,0}, {1,1,0,0}, {1,1,1,1}. - _Geoffrey Critzer_, Dec 03 2011
		

Crossrefs

Programs

  • Magma
    I:=[1, 0, 2, 2, 8, 22]; [n le 6 select I[n] else 4*Self(n-1)-5*Self(n-2)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 28 2012
  • Mathematica
    a=Exp[x]-x; Range[0,20]! CoefficientList[Series[a^2, {x,0,20}], x] (* Geoffrey Critzer, Dec 03 2011 *)
    CoefficientList[Series[1+2*x^2-2*x^3/((2*x-1)*(x-1)^2),{x,0,40}],x] (* Vincenzo Librandi, Jun 28 2012 *)

Formula

a(n) = 2^n - 2*n for n <> 2 (cf. A005803). - Rainer Rosenthal, Feb 14 2010.
E.g.f.: e^(2*x) - 2*x*e^x + x^2.
a(n) = Sum_{k=0..n} binomial(n,k)*A060576(k)*A060576(n-k).
G.f. 1 + 2*x^2 - 2*x^3/((2*x - 1)*(x - 1)^2). - R. J. Mathar, Dec 04 2011

A156901 Triangle formed by coefficients of the expansion of p(x, n), where p(x,n) = (1 + 2*x - x^2)^(n + 1)*Sum_{j >= 0} (j+1)^n*(-2*x + x^2)^j.

Original entry on oeis.org

1, 1, 1, -2, 1, 1, -8, 8, -4, 1, 1, -22, 55, -52, 23, -6, 1, 1, -52, 290, -472, 394, -188, 50, -8, 1, 1, -114, 1265, -3624, 4838, -3668, 1750, -536, 97, -10, 1, 1, -240, 4884, -24092, 49239, -56448, 40664, -19320, 6231, -1360, 180, -12, 1, 1, -494, 17419, -142124, 441625, -730898, 749723, -515944, 247067, -83122, 19673, -3244, 331, -14, 1
Offset: 0

Views

Author

Roger L. Bagula, Feb 17 2009

Keywords

Examples

			Irregular triangle begins as:
  1;
  1;
  1,   -2,    1;
  1,   -8,    8,     -4,     1;
  1,  -22,   55,    -52,    23,     -6,     1;
  1,  -52,  290,   -472,   394,   -188,    50,     -8,    1;
  1, -114, 1265,  -3624,  4838,  -3668,  1750,   -536,   97,   -10,   1;
  1, -240, 4884, -24092, 49239, -56448, 40664, -19320, 6231, -1360, 180, -12, 1;
		

Crossrefs

Programs

  • Mathematica
    p[x_, n_]= (1+2*x-x^2)^(n+1)*Sum[(k+1)^n*(-2*x+x^2)^k, {k,0,Infinity}];
    Table[CoefficientList[p[x, n], x], {n,0,10}]//Flatten
  • Sage
    def T(n, k): return ( (1+2*x-x^2)^(n+1)*sum((j+1)^n*(x^2-2*x)^j for j in (0..2*n+1)) ).series(x, 2*n+2).list()[k]
    flatten([1]+[[T(n, k) for k in (0..2*n-2)] for n in (1..12)]) # G. C. Greubel, Jan 07 2022

Formula

T(n, k) = coefficients of the expansion of p(x, n), where p(x,n) = (1 + 2*x - x^2)^(n + 1)*Sum_{j >= 0} (j+1)^n*(-2*x + x^2)^j.
T(n, 1) = (-1)*A005803(n) for n >= 2.

Extensions

Edited by G. C. Greubel, Jan 07 2022

A222403 Triangle read by rows: left and right edges are A000217, interior entries are filled in using the Pascal triangle rule.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 6, 5, 5, 6, 10, 11, 10, 11, 10, 15, 21, 21, 21, 21, 15, 21, 36, 42, 42, 42, 36, 21, 28, 57, 78, 84, 84, 78, 57, 28, 36, 85, 135, 162, 168, 162, 135, 85, 36, 45, 121, 220, 297, 330, 330, 297, 220, 121, 45, 55, 166, 341, 517, 627, 660, 627, 517, 341, 166, 55
Offset: 0

Views

Author

N. J. A. Sloane, Feb 18 2013

Keywords

Comments

In general, if the sequence defining the left and right edges is [a_0, a_1, ...], the row sums [s_0, s_1, ...] are given by s_0=a_0 and, for n>0,
s_n = 2a_n + Sum_{i=1..n-1} 2^(n-i) a_i.
Conversely, given the rows sums [s_0, s_1, ...], the edge sequence is [a_0, a_1, ...] where a_0=s_0 and, for n>0, a_n = (s_n - Sum_{i=1..n-1} s_i)/2.

Examples

			Triangle begins:
0
1, 1
3, 2, 3
6, 5, 5, 6
10, 11, 10, 11, 10
15, 21, 21, 21, 21, 15
21, 36, 42, 42, 42, 36, 21
28, 57, 78, 84, 84, 78, 57, 28
...
		

Crossrefs

Other triangles of this type: A007318, A051666, A134634, A222404, A222405.
Cf. A000217.
Row sums are A005803.

Programs

  • Maple
    d:=[seq(n*(n+1)/2,n=0..14)];
    f:=proc(d) local T,M,n,i;
    M:=nops(d);
    T:=Array(0..M-1,0..M-1);
    for n from 0 to M-1 do T[n,0]:=d[n+1]; T[n,n]:=d[n+1]; od:
    for n from 2 to M-1 do
    for i from 1 to n-1 do T[n,i]:=T[n-1,i-1]+T[n-1,i]; od: od:
    lprint("triangle:");
    for n from 0 to M-1 do lprint(seq(T[n,i],i=0..n)); od:
    lprint("row sums:");
    lprint([seq( add(T[i,j],j=0..i), i=0..M-1)]);
    end;
    f(d);
  • Mathematica
    t[n_, n_] := n*(n+1)/2; t[n_, 0] := n*(n+1)/2; t[n_, k_] := t[n, k] = t[n-1, k-1] + t[n-1, k]; Table[t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 20 2014 *)

Formula

G.f. as triangle: (1+x-4*x*y+x*y^2+x^2*y^2)*y/((1-y)^2*(-x*y+1)^2*(-x*y-y+1)). - Robert Israel, Apr 04 2018

A287416 Number T(n,k) of set partitions of [n] such that the maximal value of all absolute differences between least elements of consecutive blocks and between consecutive elements within the blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.

Original entry on oeis.org

1, 1, 0, 2, 0, 3, 2, 0, 4, 8, 3, 0, 5, 22, 19, 6, 0, 6, 52, 81, 48, 16, 0, 7, 114, 289, 267, 147, 53, 0, 8, 240, 941, 1250, 968, 529, 204, 0, 9, 494, 2894, 5310, 5469, 3919, 2174, 878, 0, 10, 1004, 8601, 21256, 28083, 25326, 17593, 9961, 4141
Offset: 0

Views

Author

Alois P. Heinz, May 24 2017

Keywords

Comments

The maximal value is assumed to be zero if there are no consecutive blocks and no consecutive elements.
T(n,k) is defined for all n,k >= 0. The triangle contains only the terms for k <= max(n-1,0). T(n,k) = 0 if k>=n and k>0.

Examples

			T(4,1) = 4: 1234, 1|234, 1|2|34, 1|2|3|4.
T(4,2) = 8: 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 1|23|4, 1|24|3.
T(4,3) = 3: 123|4, 14|23, 14|2|3.
T(5,3) = 19: 1235|4, 123|45, 123|4|5, 125|34, 125|3|4, 134|25, 134|2|5, 13|24|5, 13|25|4, 145|23, 14|235, 14|23|5, 1|234|5, 145|2|3, 14|25|3, 14|2|35, 14|2|3|5, 1|25|34, 1|25|3|4.
Triangle T(n,k) begins:
  1;
  1;
  0, 2;
  0, 3,   2;
  0, 4,   8,   3;
  0, 5,  22,  19,    6;
  0, 6,  52,  81,   48,  16;
  0, 7, 114, 289,  267, 147,  53;
  0, 8, 240, 941, 1250, 968, 529, 204;
  ...
		

Crossrefs

Columns k=1-2 give: A001477 (for n>1), A005803 (for n>0).
Row sums give A000110.

Programs

  • Maple
    b:= proc(n, k, l, t) option remember; `if`(n<1, 1, `if`(t-n>k, 0,
           b(n-1, k, map(x-> `if`(x-n>=k, [][], x), [l[], n]), n)) +add(
           b(n-1, k, sort(map(x-> `if`(x-n>=k, [][], x), subsop(j=n, l))),
           `if`(t-n>k, infinity, t)), j=1..nops(l)))
        end:
    A:= (n, k)-> b(n, min(k, n-1), [], n):
    T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
  • Mathematica
    b[n_, k_, l_, t_] := b[n, k, l, t] = If[n < 1, 1, If[t - n > k, 0, b[n - 1, k, If[# - n >= k, Nothing, #]& /@ Append[l, n], n]] + Sum[b[n - 1, k, Sort[If[# - n >= k, Nothing, #]& /@ ReplacePart[l, j -> n]], If[t - n > k, Infinity, t]], {j, 1, Length[l]}]];
    A[n_, k_] := b[n, Min[k, n - 1], {}, n];
    T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k - 1]];
    Table[T[n, k], {n, 0, 12}, { k, 0, Max[n - 1, 0]}] // Flatten (* Jean-François Alcover, May 24 2018, translated from Maple *)

Formula

T(n,k) = A287417(n,k) - A287417(n,k-1) for k>0, T(n,0) = 1.
T(n+2,n+1) = 1 + A000110(n).

A061761 a(n) = 2^n + 2*n - 1.

Original entry on oeis.org

0, 3, 7, 13, 23, 41, 75, 141, 271, 529, 1043, 2069, 4119, 8217, 16411, 32797, 65567, 131105, 262179, 524325, 1048615, 2097193, 4194347, 8388653, 16777263, 33554481, 67108915, 134217781, 268435511, 536870969, 1073741883, 2147483709
Offset: 0

Views

Author

Amarnath Murthy, May 20 2001

Keywords

Examples

			a(5) = 2^5 + 2*5 - 1 = 32 + 10 - 1 = 41. - _Michael B. Porter_, Aug 18 2016
		

Crossrefs

Programs

Formula

G.f.: x(3-5x)/((1-x)^2*(1-2x)). Binomial transform of 0,3,1,1,... (1 continued). - R. J. Mathar, Sep 17 2008
a(n) = A000225(n+1) - A005803(n), for n>0. In other words, for n>0, a(n) is the sum of the elements on the perimeter of a Pascal's triangle of depth (n+1). - Ivan N. Ianakiev, Aug 18 2016
E.g.f.: exp(x)*(exp(x) + 2*x - 1). - Stefano Spezia, Dec 08 2024

A145654 Partial sums of A000918, starting from index 1.

Original entry on oeis.org

0, 2, 8, 22, 52, 114, 240, 494, 1004, 2026, 4072, 8166, 16356, 32738, 65504, 131038, 262108, 524250, 1048536, 2097110, 4194260, 8388562, 16777168, 33554382, 67108812, 134217674, 268435400, 536870854, 1073741764, 2147483586
Offset: 1

Views

Author

Keywords

Examples

			For n=7, a(7) = 6*2 + 5*2^2 + 4*2^3 + 3*2^4 + 2*2^5 + 1*2^6 = 240. - _Bruno Berselli_, Feb 10 2014
From _Bruno Berselli_, Jul 17 2018: (Start)
Row sums of the triangle:
   0   ......................................    0
   1,  1   ..................................    2
   3,  2,  3   ..............................    8
   6,  5,  5,  6   ..........................   22
  10, 11, 10, 11, 10   ......................   52
  15, 21, 21, 21, 21, 15   ..................  114
  21, 36, 42, 42, 42, 36, 21   ..............  240
  28, 57, 78, 84, 84, 78, 57, 28   ..........  494, etc.
(End)
		

Crossrefs

Programs

  • Haskell
    a145654 n = a145654_list !! (n-1)
    a145654_list = scanl1 (+) $ tail a000918_list
    -- Reinhard Zumkeller, Nov 06 2013
  • Mathematica
    Accumulate[2^Range[30] - 2] (* or *) LinearRecurrence[{4, -5, 2}, {0, 2, 8}, 30] (* Harvey P. Dale, Jul 15 2017 *)

Formula

a(n) = Sum_{i=1..n} A000918(i).
a(n+1) - a(n) = A000918(n+1).
a(n) = A005803(n+1). - R. J. Mathar, Oct 21 2008
From Colin Barker, Jan 11 2012: (Start)
a(n) = 2*(-1 + 2^n - n).
G.f.: 2*x^2/((1-x)^2*(1-2*x)). (End)
a(n+1) = A121173(2*n). - Reinhard Zumkeller, Nov 06 2013
a(n) = Sum_{i=1..n-1} (n-i)*2^i with a(1)=0. - Bruno Berselli, Feb 10 2014
a(n) = 2 * A000295(n). - Alois P. Heinz, May 28 2018

Extensions

Edited by R. J. Mathar, Oct 21 2008

A321280 Number T(n,k) of permutations p of [n] with exactly k descents such that the up-down signature of p has nonnegative partial sums; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-1)/2)), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 8, 1, 22, 22, 1, 52, 172, 1, 114, 856, 604, 1, 240, 3488, 7296, 1, 494, 12746, 54746, 31238, 1, 1004, 43628, 330068, 518324, 1, 2026, 143244, 1756878, 5300418, 2620708, 1, 4072, 457536, 8641800, 43235304, 55717312, 1, 8166, 1434318, 40298572, 309074508, 728888188, 325024572
Offset: 0

Views

Author

Alois P. Heinz, Nov 01 2018

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  1;
  1;
  1,     2;
  1,     8;
  1,    22,      22;
  1,    52,     172;
  1,   114,     856,       604;
  1,   240,    3488,      7296;
  1,   494,   12746,     54746,      31238;
  1,  1004,   43628,    330068,     518324;
  1,  2026,  143244,   1756878,    5300418,    2620708;
  1,  4072,  457536,   8641800,   43235304,   55717312;
  1,  8166, 1434318,  40298572,  309074508,  728888188,  325024572;
  1, 16356, 4438540, 180969752, 2026885824, 7589067592, 8460090160;
  ...
		

Crossrefs

Columns k=0-3 give: A000012, A005803 (for n>0), A321268, A321269.
Row sums give A000246.
T(2n+1,n) gives A177042.
T(2n+2,n) gives A303285(n+1).

Programs

  • Maple
    b:= proc(u, o, c) option remember; `if`(c<0, 0, `if`(u+o=0, 1/x,
           add(expand(x*b(u-j, o-1+j, c-1)), j=1..u)+
           add(b(u+j-1, o-j, c+1), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(`if`(n=0, 1, b(n, 0, 1))):
    seq(T(n), n=0..14);
  • Mathematica
    b[u_, o_, c_] := b[u, o, c] = If[c < 0, 0, If[u + o == 0, 1/x, Sum[Expand[ x*b[u - j, o - 1 + j, c - 1]], {j, 1, u}] + Sum[b[u + j - 1, o - j, c + 1], {j, 1, o}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ If[n == 0, 1, b[n, 0, 1]]];
    Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Dec 08 2018, after Alois P. Heinz *)

A046740 Triangle of number of permutations of [n] with 0 successions, by number of rises.

Original entry on oeis.org

1, 1, 1, 2, 1, 8, 2, 1, 22, 28, 2, 1, 52, 182, 72, 2, 1, 114, 864, 974, 164, 2, 1, 240, 3474, 8444, 4174, 352, 2, 1, 494, 12660, 57194, 61464, 15782, 732, 2, 1, 1004, 43358, 332528, 660842, 373940, 55286, 1496, 2, 1, 2026, 142552, 1747558, 5814124
Offset: 1

Views

Author

Keywords

Comments

The recurrence given by Roselle is wrong.

Examples

			Triangle begins:
  1;
  1;
  1,  2;
  1,  8,  2;
  1, 22, 28,  2;
  ...
		

Crossrefs

Cf. A046739, A000295. Row sums give A000255. Diagonals give A005803, A065340.
Row sums give A000255.

Programs

  • Mathematica
    a[, 1] = 1; a[n, 2] := 2^n - 2*n; a[n_, r_] /; 1 <= r <= n-1 := a[n, r] = r*a[n-1, r] + (n-r)*a[n-1, r-1] + (n-2)*a[n-2, r-1]; a[, ] = 0;
    row[1] = {{1}}; row[n_] := Table[a[n, r], {r, 1, n-1}];
    Table[row[n], {n, 1, 11}] // Flatten (* Jean-François Alcover, Sep 07 2017 *)

Formula

a(n, 1) = 1; for r > 1, a(n, r) = r*a(n-1, r) + (n-r)*a(n-1, r-1) + (n-2)*a(n-2, r-1).
a(n, 2) = 2^n - 2*n = 2*A000295 = A005803, n >= 3.

Extensions

More terms from Vladeta Jovovic, Jan 03 2003
Previous Showing 11-20 of 38 results. Next