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

A154327 Diagonal sums of number triangle A132046.

Original entry on oeis.org

1, 1, 2, 5, 8, 15, 24, 41, 66, 109, 176, 287, 464, 753, 1218, 1973, 3192, 5167, 8360, 13529, 21890, 35421, 57312, 92735, 150048, 242785, 392834, 635621, 1028456, 1664079, 2692536, 4356617, 7049154, 11405773, 18454928, 29860703, 48315632, 78176337, 126491970, 204668309, 331160280, 535828591, 866988872
Offset: 0

Views

Author

Paul Barry, Jan 07 2009

Keywords

Crossrefs

A shifted version of A066629.

Programs

  • Magma
    [0^n-(3+(-1)^n)/2+2*Fibonacci(n+1):n in [0..40]]; // Vincenzo Librandi, Sep 12 2016
  • Mathematica
    Join[{1}, LinearRecurrence[{1, 2, -1, -1}, {1, 2, 5, 8}, 25]] (* G. C. Greubel, Sep 11 2016 *)
    CoefficientList[Series[(1 - x^2 + 2 x^3 + x^4) / ((1 - x^2) (1 - x - x^2)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 12 2016 *)

Formula

G.f.: (1 - x^2 + 2x^3 + x^4)/( (1-x^2)*(1-x-x^2) ).
a(n) = 0^n - (3 + (-1)^n)/2 + 2*Fibonacci(n+1).

A141540 Duplicate of A132046.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 6, 6, 1, 1, 8, 12, 8, 1, 1, 10, 20, 20, 10, 1, 1, 12, 30, 40, 30, 12, 1, 1, 14, 42, 70, 70, 42, 14, 1, 1, 16, 56, 112, 140, 112, 56, 16, 1, 1, 18, 72, 168, 252, 252, 168, 72, 18, 1, 1, 20, 90, 240, 420, 504, 420, 240, 90, 20, 1
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Aug 15 2008

Keywords

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

Original entry on oeis.org

1, 2, 6, 14, 30, 62, 126, 254, 510, 1022, 2046, 4094, 8190, 16382, 32766, 65534, 131070, 262142, 524286, 1048574, 2097150, 4194302, 8388606, 16777214, 33554430, 67108862, 134217726, 268435454, 536870910, 1073741822, 2147483646, 4294967294, 8589934590
Offset: 0

Views

Author

Paul Barry, May 28 2004

Keywords

Comments

a(n+1)/2 = A000225(n). Binomial transform is A002783. Binomial transform of 2 - 2*0^n + (-1)^n or 1,1,3,1,3,1,3,1,...
From Peter C. Heinig (algorithms(AT)gmx.de), Apr 17 2007: (Start)
Number of n-tuples where each entry is chosen from the subsets of {1,2} such that the intersection of all n entries contains exactly one element.
There is the following general formula: The number T(n,k,r) of n-tuples where each entry is chosen from the subsets of {1,2,..,k} such that the intersection of all n entries contains exactly r elements is: T(n,k,r) = binomial(k,r) * (2^n - 1)^(k-r). This may be shown by exhibiting a bijection to a set whose cardinality is obviously binomial(k,r) * (2^n - 1)^(k-r), namely the set of all k-tuples where each entry is chosen from subsets of {1,..,n} in the following way: Exactly r entries must be {1,..,n} itself (there are binomial(k,r) ways to choose them) and the remaining (k-r) entries must be chosen from the 2^n-1 proper subsets of {1,..,n}, i.e., for each of the (k-r) entries, {1,..,n} is forbidden (there are, independent of the choice of the full entries, (2^n - 1)^(k-r) possibilities to do that, hence the formula). The bijection into this set is given by (X_1,..,X_n) |-> (Y_1,..,Y_k) where for each j in {1,..,k} and each i in {1,..,n}, i is in Y_j if and only if j is in X_i.
Examples: a(1)=2 because the two tuples of length one are: ({1}) and ({2}).
a(3)=14 because the fourteen tuples of length three are: ({1},{1},{1}), ({2},{2},{2}), ({1,2},{1},{1}), ({1},{1,2},{1}), ({1},{1},{1,2}), ({1,2},{2},{2}), ({2},{1,2},{2}), ({2},{2},{1,2}), ({1,2},{1,2},{1}), ({1,2},{1},{1,2}), ({1},{1,2},{1,2}), ({1,2}{1,2}{2}), ({1,2}{2}{1,2}), ({2}{1,2}{1,2}).
The image of this set of tuples under the bijection described in the comment is: ({1,2,3},{}), ({},{1,2,3}), ({1,2,3},{1}), ({1,2,3},{2}), ({1,2,3},{3}), ({1},{1,2,3}), ({2},{1,2,3}), ({3},{1,2,3}), ({1,2,3},{1,2}), ({1,2,3},{1,3}), ({1,2,3},{2,3}), ({1,2},{1,2,3}), ({1,3},{1,2,3}), ({2,3},{1,2,3}). Here exactly one entry is {1,..,n}={1,2,3} and the other is a proper subset. (End)
An elephant sequence, see A175654. For the corner squares just one A[5] vector, with decimal value 170, leads to this sequence. For the central square this vector leads to the companion sequence A151821. - Johannes W. Meijer, Aug 15 2010
Conjecture: a(n) is the least m>0 such that A007814(A000108(m)) = n, where A000108 gives the Catalan numbers and A007814(x) is the 2-adic valuation of x (cf. A048881). - L. Edson Jeffery, Nov 26 2015
Also, the decimal representation of the diagonal from the corner to the origin of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 645", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Jul 19 2017

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Programs

  • Magma
    [-2+4*2^(n-1)+(Binomial(2*n,n) mod 2): n in [0..40]]; // Vincenzo Librandi, Aug 14 2015
    
  • Maple
    ZL := [S, {S=Prod(B,B), B=Set(Z, 1 <= card)}, labeled]: seq(combstruct[ count](ZL, size=n), n=1..31); # Zerinvary Lajos, Mar 13 2007
    for k from 1 to 31 do 2*(2^k-1); od;
  • Mathematica
    Join[{1}, LinearRecurrence[{3, -2}, {2, 6}, 50]] (* Vladimir Joseph Stephan Orlovsky, Feb 24 2012 *)
    Join[{1},NestList[2#+2&,2,40]] (* Harvey P. Dale, Dec 25 2013 *)
  • PARI
    Vec((1-x+2*x^2)/((1-x)*(1-2*x)) + O(x^40)) \\ Michel Marcus, Aug 14 2015
    
  • PARI
    vector(100, n, n--; if(n==0, 1, 2*2^n-2)) \\ Altug Alkan, Nov 26 2015

Formula

G.f.: (1-x+2*x^2)/((1-x)*(1-2*x)).
a(n) = A000918(n+1), n >= 1.
a(n) = 2*2^n - 2 + 0^n; a(n) = 3*a(n-1) - 2*a(n-2).
a(0)=1, a(1)=2, a(n) = 2*a(n-1) + 2 for n>1. - Philippe Deléham, Sep 28 2006
a(n) = Sum_{k=0..n} 2^k*A123110(n,k). - Philippe Deléham, Feb 09 2007
a(n) = 5*a(n-2) - 4*a(n-4) for n>4 [Because x(n)=f*x(n-1)+g*x(n-2) => x(n)=(f^2+2*g)*x(n-2)-g^2*x(n-4), here with f=3 and g=-2]. - Hermann Stamm-Wilbrandt, Aug 13 2015
E.g.f.: 1 + 2*exp(x)*(exp(x) - 1). - Stefano Spezia, Feb 25 2022

Extensions

Edited by N. J. A. Sloane, Apr 25 2007

A100320 A Catalan transform of (1 + 2*x)/(1 - 2*x).

Original entry on oeis.org

1, 4, 12, 40, 140, 504, 1848, 6864, 25740, 97240, 369512, 1410864, 5408312, 20801200, 80233200, 310235040, 1202160780, 4667212440, 18150270600, 70690527600, 275693057640, 1076515748880, 4208197927440, 16466861455200, 64495207366200, 252821212875504, 991837065896208
Offset: 0

Views

Author

Paul Barry, Nov 14 2004

Keywords

Comments

A Catalan transform of (1 + 2*x)/(1 - 2*x) under the mapping g(x) -> g(x*c(x)). (Here c(x) is the g.f. of A000108.) The original sequence can be retrieved by g(x) -> g(x*(1-x)).
Hankel transform is A144704. - Paul Barry, Sep 19 2008
Central terms of the triangle in A124927. - Reinhard Zumkeller, Mar 04 2012

Crossrefs

Programs

Formula

G.f.: (1 + 2*x*c(x))/(1 - 2*x*c(x)), where c(x) is the g.f. of A000108.
a(n) = 4*binomial(2*n-1, n) - 3*0^n.
a(n) = binomial(2*n, n)*(4*2^(n-1) - 0^n)/2^n.
a(n) = Sum_{j=0..n} Sum_{k=0..n} C(2*n, n-k)*((2*k + 1)/(n + k + 1))*C(k, j)*(-1)^(j-k)*(4*2^(j-1) - 0^j).
a(n) = A028329(n), n > 0. - R. J. Mathar, Sep 02 2008
a(n) = T(2*n,n), where T(n,k) = A132046(n,k). - Paul Barry, Sep 19 2008
a(n) = Sum_{k=0..n} A039599(n,k)*A010684(k). - Philippe Deléham, Oct 29 2008
a(n) = A095660(2*n,n) for n > 0. - Reinhard Zumkeller, Apr 08 2012
G.f.: G(0) - 1, where G(k) = 1 + 1/(1 - 2*x*(2*k + 1)/(2*x*(2*k + 1) + (k + 1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
a(n) = [x^n] (1 + 2*x)/(1 - x)^(n+1). - Ilya Gutkovskiy, Oct 12 2017
a(n) = 2*(2*n-1)*a(n-1)/n. - G. C. Greubel, Feb 01 2023
E.g.f.: 2*exp(2*x)*BesselI(0, 2*x) - 1. - Stefano Spezia, May 11 2024

Extensions

Incorrect connection with A046055 deleted by N. J. A. Sloane, Jul 08 2009

A168641 Triangle read by rows: T(n,k) = [x^k] p(x,n), where p(x,n) = 3*(x + 1)^n - 2*(x^n + 1) - n*(x + x^(n - 1)) for n >= 2, p(x,0) = 1, and p(x,1) = x + 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 6, 6, 1, 1, 8, 18, 8, 1, 1, 10, 30, 30, 10, 1, 1, 12, 45, 60, 45, 12, 1, 1, 14, 63, 105, 105, 63, 14, 1, 1, 16, 84, 168, 210, 168, 84, 16, 1, 1, 18, 108, 252, 378, 378, 252, 108, 18, 1, 1, 20, 135, 360, 630, 756, 630, 360, 135, 20, 1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 01 2009

Keywords

Examples

			Triangle begins:
  1;
  1,  1;
  1,  2,   1;
  1,  6,   6,   1;
  1,  8,  18,   8,   1;
  1, 10,  30,  30,  10,   1;
  1, 12,  45,  60,  45,  12,   1;
  1, 14,  63, 105, 105,  63,  14,   1;
  1, 16,  84, 168, 210, 168,  84,  16,  1;
  1, 18, 108, 252, 378, 378, 252, 108,  18,  1;
  1, 20, 135, 360, 630, 756, 630, 360, 135, 20, 1;
  ...
		

Crossrefs

Columns (essentially): A005843 (k=1), A045943 (k=2), A027480 (k=3), A050534 (k=4), A253942 (k=5), A253943 (k=6), A253944 (k=7).

Programs

  • Magma
    function f(n,k)
       if n le 2 then return 1;
       elif k eq 0 or k eq n then return 1;
       elif k eq 1 or k eq n-1 then return 2;
       else return 3;
       end if;
    end function;
    A168641:= func< n,k | Binomial(n,k)*f(n,k) >;
    [A168641(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Mar 24 2025
    
  • Mathematica
    p[x_, n_]:= If[n==0, 1, If[n==1, 1+x, 3*(1+x)^n -(1+x^n) -(1+n*x +n*x^(n-1) + x^n)]];
    Flatten[Table[CoefficientList[p[x, n], x], {n, 0, 10}]]
    (* Second program *)
    f[n_, k_]:= With[{b=Boole}, If[k<=n/2, b[k==0] +2*b[k==1] +3*b[2<=k<=n/2], f[n, n-k]]];
    A168641[n_, k_]:= Binomial[n,k]*If[n<3,1,f[n,k]];
    Table[A168641[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Mar 24 2025 *)
  • Maxima
    T(n,k) := ratcoef(if n <= 2 then (1 + x)^n else 3*(x + 1)^n - (x^n + 1) - (x^n + n*x^(n - 1) + n*x + 1), x, k);
    create_list(T(n, k), n, 0, 12, k, 0, n); /* Franck Maminirina Ramaharo, Jan 02 2019 */
    
  • SageMath
    def f(n,k):
        if (k<=n/2): return int(k==0) + 2*int(k==1) + 3*int(1A168641(n,k):
        if (n<3): return binomial(n,k)
        else: return binomial(n,k)*f(n,k)
    print(flatten([[A168641(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Mar 24 2025

Formula

From G. C. Greubel, Mar 24 2025: (Start)
T(n, k) = 3*binomial(n, k), for n >= 4 and 2 <= k <= n-2, otherwise T(n, 0) = T(n, n) = 1, T(n, 1) = T(n, n-1) = 2*A065475(n-1).
T(n, n-k) = T(n, k).
T(n, 1) = A005843(n) - [n=1] - 2*[n=2].
Columns: T(n, k) = 3*binomial(n,k) - 2*[n=k] - (k+1)*[n=k+1], k >= 2.
Sum_{k=0..n} T(n, k) = 2*A095151(n-1) - 2*[n=0] - 2*[n=1].
Sum_{k=0..n} (-1)^k*T(n, k) = (1+(-1)^n)*(n-2) + 5*[n=0]. (End)

Extensions

Edited by Franck Maminirina Ramaharo, Jan 02 2019

A168643 Triangle read by rows: T(n,k) = [x^k] p(x,n) where p(x,0) = 1, p(x,n) = (6 - n)*(1+x)^n - (5-n)*(1 + x^n) for 1 <= n <= 4, and p (x,n) = 4*(1+x)^n - Sum_{i=0..2} (Sum_{j=0..i} binomial(n, j)*(x^j + x^(n-j))) for n >= 5.

Original entry on oeis.org

1, 1, 1, 1, 8, 1, 1, 9, 9, 1, 1, 8, 12, 8, 1, 1, 10, 30, 30, 10, 1, 1, 12, 45, 80, 45, 12, 1, 1, 14, 63, 140, 140, 63, 14, 1, 1, 16, 84, 224, 280, 224, 84, 16, 1, 1, 18, 108, 336, 504, 504, 336, 108, 18, 1, 1, 20, 135, 480, 840, 1008, 840, 480, 135, 20, 1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 01 2009

Keywords

Examples

			Triangle begins:
  1;
  1,  1;
  1,  8,   1;
  1,  9,   9,   1;
  1,  8,  12,   8,   1;
  1, 10,  30,  30,  10,    1;
  1, 12,  45,  80,  45,   12,   1;
  1, 14,  63, 140, 140,   63,  14,   1;
  1, 16,  84, 224, 280,  224,  84,  16,   1;
  1, 18, 108, 336, 504,  504, 336, 108,  18,  1;
  1, 20, 135, 480, 840, 1008, 840, 480, 135, 20, 1;
  ...
		

Crossrefs

Programs

  • Mathematica
    (* First program *)
    p[x_, n_]:= If[n==0, 1, If[n==1, x+1, 4*(1+x)^n - (1+x^n) - If[n>2, x^n + n*x^(n-1) +n*x+1, 1+x^n] - If[n>3, x^n +n*x^(n-1) + Binomial[n,2]*(x^2 +x^(n-2)) +n*x+1, 1+x^n]]];
    Flatten[Table[CoefficientList[p[x, n], x], {n, 0, 10}]]
    (* Second program *)
    f[n_,k_]:= With[{B=Boole}, If[n==0, 1, If[0n-3]]]];
    A168643[n_,k_]:= Binomial[n,k]*f[n,k];
    Table[A168643[n,k], {n,0,13}, {k,0,n}]//Flatten (* G. C. Greubel, Apr 08 2025 *)
  • Maxima
    T(n,k) := if k = 0 or k = n then 1 else (if n <= 4 then (6 - n)*binomial(n, k) else ratcoef(4*(x + 1)^n - sum(sum(binomial(n, j)*(x^j + x^(n - j)), j, 1, i), i, 1, 2), x, k))$
    create_list(T(n, k), n, 0, 12, k, 0, n); /* Franck Maminirina Ramaharo, Jan 02 2019 */
    
  • SageMath
    def f(n,k):
        if n==0: return 1
        elif 0n-3)
    def A168643(n,k): return binomial(n,k)*f(n,k)
    print(flatten([[A168643(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Apr 08 2025

Formula

From G. C. Greubel, Apr 08 2025: (Start)
T(n, k) = [k=0] + (6-n)*binomial(n,k)*[1 <= k <= n-1] + [k=n] if 1 <= n <= 4, T(n, k) = binomial(n,k)*( (k+1)*[k<3] + 4*[2 < k < n-2] + (n-k+1)*[k > n-3] ) if n >= 5, with T(n, 0) = T(n, n) = 1.
T(n, n-k) = T(n, k) (symmetric rows).
Sum_{k=0..n} T(n, k) = 2^(n+2) - n^2 - 3*n - 6 + 13*[n=3] + 10*[n=2] + 4*[n=1] + 3*[n=0]. (End)

Extensions

Edited by Franck Maminirina Ramaharo, Jan 02 2019

A168644 Triangle read by rows: T(n, k) = [x^k] p(x,n), where p(x,0) = 1, p(x,n) = (7 - n)*(1+x)^n - (6-n)*(1 + x^n) for 1 <= n <= 5, and p(x,n) = 5*(1 + x)^n - Sum_{i=0..3} (Sum_{j=0..i} binomial(n, j)*(x^j + x^(n-j))) + (1/6)*n*(n - 1)*(n - 5)*x^(n-3) for n >= 6.

Original entry on oeis.org

1, 1, 1, 1, 10, 1, 1, 12, 12, 1, 1, 12, 18, 12, 1, 1, 10, 20, 20, 10, 1, 1, 12, 45, 65, 45, 12, 1, 1, 14, 63, 140, 154, 63, 14, 1, 1, 16, 84, 224, 350, 252, 84, 16, 1, 1, 18, 108, 336, 630, 630, 384, 108, 18, 1, 1, 20, 135, 480, 1050, 1260, 1050, 555, 135, 20, 1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 01 2009

Keywords

Examples

			Triangle begins:
  1;
  1,  1;
  1, 10,   1;
  1, 12,  12,   1;
  1, 12,  18,  12,    1;
  1, 10,  20,  20,   10,    1;
  1, 12,  45,  65,   45,   12,    1;
  1, 14,  63, 140,  154,   63,   14,   1;
  1, 16,  84, 224,  350,  252,   84,  16,   1;
  1, 18, 108, 336,  630,  630,  384, 108,  18,  1;
  1, 20, 135, 480, 1050, 1260, 1050, 555, 135, 20, 1;
  ...
		

Crossrefs

Programs

  • Mathematica
    (* First program *)
    p[x_, n_]:= If[n<2, (1+x)^n, 5*(1+x)^n -(1+x^n) - If[n>2, x^n +n*x^(n-1) + n*x +1, 1+x^n] - If[n>3, x^n +n*x^(n-1) +Binomial[n,2]*(x^2 +x^(n-2)) + n*x +1, 1+x^n] - If[n>4, x^n +n*x^(n-1) +Binomial[n,2]*(x^2 +x^(n-3) +x^(n-2)) + Binomial[n,3]*x^3 +n*x +1, 1+x^n]];
    Flatten[Table[CoefficientList[p[x, n], x], {n, 0, 10}]]
    (* Second program *)
    f[n_, k_]:= With[{B=Boole}, If[k==0 || k==n, 1, If[1<=n<=5, (7-n) - (6-n)*(B[k==0] + B[k==n]), If[n==6, (k+1)*B[k<4] + (n-k+1)*B[k>3] - B[k==3], (k + 1)*B[k<4] + 5*B[3n-4]]]]];
    A168644[n_, k_]:= Binomial[n,k]*f[n,k] + If[n>5, n*(n-1)*(n-5)*Boole[k==n-3]/6, 0];
    Table[A168644[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Apr 06 2025 *)
  • Maxima
    T(n, k) := if k = 0 or k = n then 1 else (if n <= 5 then (7 - n)*binomial(n, k) else ratcoef(5*(x + 1)^n - sum(sum(binomial(n, j)*(x^j + x^(n - j)), j, 1, i), i, 1, 3) + (1/6)*n*(n - 1)*(n - 5)*x^(n - 3), x, k))$
    create_list(T(n, k), n, 0, 12, k, 0, n); /* Franck Maminirina Ramaharo, Jan 02 2019 */
    
  • SageMath
    def f(n, k):
        if k==0 or k==n: return 1
        elif 03) - int(k==3)
        else: return (k+1)*int(k<4) + 5*int(3n-4)
    def A168644(n, k):
        if n<6: return binomial(n, k)*f(n, k)
        else: return binomial(n,k)*f(n,k) + n*(n-1)*(n-5)*int(k==n-3)//6
    print(flatten([[A168644(n, k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Apr 06 2025

Extensions

Edited by Franck Maminirina Ramaharo, Jan 02 2019

A168646 Triangle read by rows: T(n,k) = [x^k] p(x,n), where p(x,0) = 1, p(x,n) = (8 - n)*(1+x)^n - (7 - n)*(1 + x^n) for 1 <= n <= 6, and p(x,n) = 6*(1+x)^n - Sum_{i=0..4} (Sum_{j=0..i} binomial(n, j)*(x^j + x^(n-j))) for n >= 7.

Original entry on oeis.org

1, 1, 1, 1, 12, 1, 1, 15, 15, 1, 1, 16, 24, 16, 1, 1, 15, 30, 30, 15, 1, 1, 12, 30, 40, 30, 12, 1, 1, 14, 63, 315, 315, 63, 14, 1, 1, 16, 84, 224, 700, 224, 84, 16, 1, 1, 18, 108, 336, 630, 630, 336, 108, 18, 1, 1, 20, 135, 480, 1050, 1512, 1050, 480, 135, 20, 1, 1, 22, 165, 660, 1650, 2772, 2772, 1650, 660, 165, 22, 1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Dec 01 2009

Keywords

Examples

			Triangle begins:
  1;
  1,  1;
  1, 12,   1;
  1, 15,  15,   1;
  1, 16,  24,  16,    1;
  1, 15,  30,  30,   15,    1;
  1, 12,  30,  40,   30,   12,    1;
  1, 14,  63, 315,  315,   63,   14,   1;
  1, 16,  84, 224,  700,  224,   84,  16,   1;
  1, 18, 108, 336,  630,  630,  336, 108,  18,  1;
  1, 20, 135, 480, 1050, 1512, 1050, 480, 135, 20, 1;
  ...
		

Crossrefs

Programs

  • Mathematica
    (* First program *)
    p[n_, x_]:= With[{B=Binomial}, If[n==0, 1, If[1<=n<=6, 1 + (8-n)*Sum[B[n,j]*x^j, {j, n -1}] +x^n, Sum[(j+1)*B[n,j]*x^j, {j,0,4}] +6*Sum[B[n,j]*x^j, {j,5,n-5}] + Sum[(n-j+ 1)*B[n,j]*x^j, {j,n-4,n}]]]];
    Flatten[Table[CoefficientList[p[n,x], x], {n, 0, 12}]]
    (* Second program *)
    f[n_, k_]:= If[k==0||k==n,1,If[1<=n<= 6 && 1<=k<=n-1, 8-n, (k+1)*Boole[k<=4] + 6*Boole[5<=k<=n-5] +(n-k+1)*Boole[n-4<=k<=n]]];
    A168646[n_, k_]:= Binomial[n,k]*f[n,k];
    Table[A168646[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Apr 05 2025 *)
  • Maxima
    T(n,k) := if k = 0 or k = n then 1 else (if n <= 6 then (8 - n)*binomial(n, k) else ratcoef(6*(x + 1)^n - sum(sum(binomial(n, j)*(x^j + x^(n - j)), j, 1, i), i, 1, 4), x, k))$
    create_list(T(n, k), n, 0, 12, k, 0, n); /* Franck Maminirina Ramaharo, Jan 02 2019 */
    
  • SageMath
    def f(n,k):
        if k==0 or k==n: return 1
        elif 0n-5)
    def A168646(n,k): return binomial(n,k)*f(n,k)
    print(flatten([[A168646(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Apr 05 2025

Formula

T(n, n-k) = T(n, k). - G. C. Greubel, Apr 05 2025

Extensions

Edited by Franck Maminirina Ramaharo, Jan 02 2019
Data values T(7,3), T(7,4), T(8,4) corrected by G. C. Greubel, Apr 05 2025

A132737 Triangle T(n,k) = 2*binomial(n,k) + 1, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 5, 1, 1, 7, 7, 1, 1, 9, 13, 9, 1, 1, 11, 21, 21, 11, 1, 1, 13, 31, 41, 31, 13, 1, 1, 15, 43, 71, 71, 43, 15, 1, 1, 17, 57, 113, 141, 113, 57, 17, 1, 1, 19, 73, 169, 253, 253, 169, 73, 19, 1, 1, 21, 91, 241, 421, 505, 421, 241, 91, 21, 1, 1, 23, 111, 331, 661, 925, 925, 661, 331, 111, 23, 1
Offset: 0

Views

Author

Gary W. Adamson, Aug 26 2007

Keywords

Examples

			First few rows of the triangle are:
  1;
  1,  1;
  1,  5,  1;
  1,  7,  7,  1;
  1,  9, 13,  9,  1;
  1, 11, 21, 21, 11,  1;
  1, 13, 31, 41, 31, 13,  1;
  1, 15, 43, 71, 71, 43, 15, 1;
  ...
		

Crossrefs

Sequences of the form 2*binomial(n,k) + q: A132729 (q=-3), A132731 (q=-2), A109128 (q=-1), A132046 (q=0), this sequence (q=1).

Programs

  • Magma
    A132737:= func< n,k | k eq 0 or k eq n select 1 else 2*Binomial(n,k) +1 >;
    [A132737(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Feb 15 2021
  • Mathematica
    T[n_, k_]:= If[k==0 || k==n, 1, 2*Binomial[n,k] +1];
    Table[T[n, k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Feb 15 2021 *)
  • Sage
    def A132737(n,k): return 1 if (k==0 or k==n) else 2*binomial(n,k) + 1
    flatten([[A132737(n,k) for k in (0..n)] for n in (0..15)]) # G. C. Greubel, Feb 15 2021
    

Formula

T(n, k) = 2*A132735(n, k) - 1, an infinite lower triangular matrix.
T(n,0) = T(n,n) = 1; otherwise T(n,k) = 2*C(n,k) + 1. - Franklin T. Adams-Watters, Jul 06 2009
Sum_{k=0..n} T(n, k) = 2^(n+1) + n - 3 + 2*[n=0] = A132738(n). - G. C. Greubel, Feb 15 2021

Extensions

Extended by Franklin T. Adams-Watters, Jul 06 2009
Showing 1-9 of 9 results.