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 72 results. Next

A051597 Rows of triangle formed using Pascal's rule except begin and end n-th row with n+1.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 4, 7, 7, 4, 5, 11, 14, 11, 5, 6, 16, 25, 25, 16, 6, 7, 22, 41, 50, 41, 22, 7, 8, 29, 63, 91, 91, 63, 29, 8, 9, 37, 92, 154, 182, 154, 92, 37, 9, 10, 46, 129, 246, 336, 336, 246, 129, 46, 10, 11, 56, 175, 375, 582, 672, 582, 375, 175, 56, 11
Offset: 0

Views

Author

Keywords

Comments

Row sums give A033484(n).
The number of spotlight tilings of an (m+1) X (n+1) rectangle, read by antidiagonals. - Bridget Tenner, Nov 09 2007
T(n,k) = A134636(n,k) - A051601(n,k). - Reinhard Zumkeller, Nov 23 2012
T(n,k) = A209561(n+2,k+1), 0 <= k <= n. - Reinhard Zumkeller, Dec 26 2012
For a closed-form formula for arbitrary left and right borders of Pascal like triangle see A228196. - Boris Putievskiy, Aug 19 2013
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 09 2013

Examples

			Triangle begins as:
  1;
  2,  2;
  3,  4,  3;
  4,  7,  7,  4;
  5, 11, 14, 11, 5;
		

Crossrefs

Stripped variant of A072405, A122218.

Programs

  • GAP
    T:= function(n,k)
        if k<0 or k>n then return 0;
        elif k=0 or k=n then return n+1;
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Nov 18 2019
  • Haskell
    a051597 n k = a051597_tabl !! n !! k
    a051597_row n = a051597_tabl !! n
    a051597_tabl = iterate (\row -> zipWith (+) ([1] ++ row) (row ++ [1])) [1]
    -- Reinhard Zumkeller, Nov 23 2012
    
  • Magma
    function T(n,k)
        if k lt 0 or k gt n then return 0;
      elif k eq 0 or k eq n then return n+1;
      else return T(n-1,k-1) + T(n-1,k);
      end if;
      return T;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 18 2019
    
  • Maple
    T:= proc(n, k) option remember;
          `if`(k<0 or k>n, 0,
          `if`(k=0 or k=n, n+1,
             T(n-1, k-1) + T(n-1, k) ))
        end:
    seq(seq(T(n, k), k=0..n), n=0..14);  # Alois P. Heinz, May 27 2013
  • Mathematica
    NestList[Append[ Prepend[Map[Apply[Plus, #] &, Partition[#, 2, 1]], #[[1]] + 1], #[[1]] + 1] &, {1}, 10] // Grid  (* Geoffrey Critzer, May 26 2013 *)
    T[n_, k_] := T[n, k] = If[k<0 || k>n, 0, If[k==0 || k==n, n+1, T[n-1, k-1] + T[n-1, k]]]; Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 09 2016, after Alois P. Heinz *)
  • PARI
    T(n,k) = if(k<0 || k>n, 0, if(k==0 || k==n, n+1, T(n-1, k-1) + T(n-1, k) ));
    for(n=0, 12, for(k=0, n, print1(T(n,k), ", "))) \\ G. C. Greubel, Nov 18 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k<0 or k>n): return 0
        elif (k==0 or k==n): return n+1
        else: return T(n-1, k-1) + T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 18 2019
    

Formula

T(2n,n) = A051924(n+1). - Philippe Deléham, Nov 26 2006
T(m,n) = binomial(m+n,m) - binomial(m+n-2,m-1) (correct up to offset and transformation of square indices to triangular indices). - Bridget Tenner, Nov 09 2007
T(0,n) = T(n,0) = n+1, T(n,k) = T(n-1,k) + T(n-1,k-1), 0 < k < n.
From Peter Bala, Feb 28 2013: (Start)
T(n,k) = binomial(n,k-1) + binomial(n,k) + binomial(n,k+1) for 0 <= k <= n.
O.g.f.: (1 - xt^2)/((1 - t)(1 - xt)(1 - (1+x)t)) = 1 + (2 + 2x)t + (3 + 4x + 3x^2)t^2 + ....
Row polynomials: ((1+x+x^2)*(1+x)^n - 1 - x^(n+2))/x. (End)

A155116 a(n) = 3*a(n-1) + 3*a(n-2), n>2, a(0)=1, a(1)=2, a(2)=8.

Original entry on oeis.org

1, 2, 8, 30, 114, 432, 1638, 6210, 23544, 89262, 338418, 1283040, 4864374, 18442242, 69919848, 265086270, 1005018354, 3810313872, 14445996678, 54768931650, 207644784984, 787241149902, 2984657804658, 11315696863680, 42901064005014
Offset: 0

Views

Author

Philippe Deléham, Jan 20 2009

Keywords

Comments

From Johannes W. Meijer, Aug 14 2010: (Start)
A berserker sequence, see A180140 and A180147. For the central square 16 A[5] vectors with decimal values between 3 and 384 lead to this sequence. These vectors lead for the corner squares to A123620 and for the side squares to A180142.
This sequence belongs to a family of sequences with GF(x)=(1-(2*k-1)*x-k*x^2)/(1-3*x+(k-4)*x^2). Berserker sequences that are members of this family are A000007 (k=2), A155116 (k=1; this sequence), A000302 (k=0), 6*A179606 (k=-1; with leading 1 added) and 2*A180141 (k=-2; n>=1 and a(0)=1). Some other members of this family are (-2)*A003688 (k=3; with leading 1 added), (-4)*A003946 (k=4; with leading 1 added), (-6)*A002878 (k=5; with leading 1 added) and (-8)*A033484 (k=6; with leading 1 added).
Inverse binomial transform of A101368 (without the first leading 1).
(End)

Crossrefs

Sequences of the form a(n) = m*(a(n-1) + a(n-2)) with a(0)=1, a(1) = m-1, a(2) = m^2 -1: A155020 (m=2), this sequence (m=3), A155117 (m=4), A155119 (m=5), A155127 (m=6), A155130 (m=7), A155132 (m=8), A155144 (m=9), A155157 (m=10).

Programs

  • Magma
    m:=3; [1] cat [n le 2 select (m-1)*(m*n-(m-1)) else m*(Self(n-1) + Self(n-2)): n in [1..30]]; // G. C. Greubel, Mar 25 2021
    
  • Mathematica
    With[{m=3}, LinearRecurrence[{m, m}, {1, m-1, m^2-1}, 30]] (* G. C. Greubel, Mar 25 2021 *)
  • PARI
    Vec((1-x-x^2)/(1-3*x-3*x^2)+O(x^99)) \\ Charles R Greathouse IV, Jan 12 2012
    
  • Sage
    m=3; [1]+[-(m-1)*(sqrt(m)*i)^(n-2)*chebyshev_U(n, -sqrt(m)*i/2) for n in (1..30)] # G. C. Greubel, Mar 25 2021

Formula

G.f.: (1-x-x^2)/(1-3*x-3*x^2).
a(n) = 2*A125145(n-1), n>=1 .
a(n) = ( (2+4*A)*A^(-n-1) + (2+4*B)*B^(-n-1) )/21 with A=(-3+sqrt(21))/6 and B=(-3-sqrt(21))/6 for n>=1 with a(0)=1. [corrected by Johannes W. Meijer, Aug 12 2010]
Contribution from Johannes W. Meijer, Aug 14 2010: (Start)
a(n) = A123620(n)/2 for n>=1.
(End)
a(n) = (1/3)*[n=0] - 2*(sqrt(3)*i)^(n-2)*ChebyshevU(n, -sqrt(3)*i/2). - G. C. Greubel, Mar 25 2021

A160161 First differences of the 3D toothpick numbers A160160.

Original entry on oeis.org

0, 1, 2, 4, 8, 8, 8, 8, 16, 32, 56, 32, 16, 8, 16, 32, 56, 56, 64, 80, 152, 232, 352, 144, 48, 32, 24, 40, 56, 56, 64, 80, 152, 232, 352, 216, 168, 176, 272, 360, 496, 448, 536, 664, 1168, 1488, 2000, 768, 304, 336, 264, 192, 112, 120, 128, 112, 168, 240, 352, 216, 168, 176, 272, 360, 496
Offset: 0

Views

Author

Omar E. Pol, May 03 2009

Keywords

Comments

Number of toothpicks added at n-th stage to the three-dimensional toothpick structure of A160160.
The sequence should start with a(1) = 1 = A160160(1) - A160160(0), the initial a(0) = 0 seems purely conventional and not given in terms of A160160. The sequence can be written as a table with rows r >= 0 of length 1, 1, 1, 3, 9, 18, 36, ... = 9*2^(r-4) for row r >= 4. In that case, rows 0..3 are filled with 2^r, and all rows r >= 3 have the form (x_r, y_r, x_r) where x_r and y_r have 3*2^(r-4) elements, all multiples of 8. Moreover, y_r[1] = a(A033484(r-2)) = x_{r+1}[1] = a(A176449(r-3)) is the largest element of row r and thus a record value of the sequence. - M. F. Hasler, Dec 11 2018

Examples

			Array begins:
===================
    x     y     z
===================
          0     1
    2     4     8
    8     8     8
   16    32    56
   32    16     8
   16    32    56
   56    64    80
  152   232   352
  144    48    32
...
From _Omar E. Pol_, Feb 28 2018: (Start)
Also, starting with 1, the sequence can be written as an irregular triangle in which the row lengths are the terms of A011782 multiplied by 3, as shown below:
   1,  2,  4;
   8,  8,  8;
   8, 16, 32, 56, 32, 16;
   8, 16, 32, 56, 56, 64, 80, 152, 232, 352, 144, 48;
  32, 24, 40, 56, 56, 64, 80, 152, 232, 352, 216, 168, 176, 272, 360, 496, 448, ...
(End)
If one starts rows with a(A176449(k) = 9*2^k-2), they are of the form A_k, B_k, A_k where A_k and B_k have 3*2^k elements and the first element of A_k is the first element of B_{k-1} and the largest of that (previous) row:
   k | a(9*2^k-2, ...) = A_k ; B_k ; A_k
  ---+-------------------------------------
     | a( 1 .. 6) = (1, 2, 4, 8, 8, 8)   (One might consider a row (8 ; 8 ; 8).)
   0 | a( 7, ...) = (8, 16, 32 ; 56, 32, 16 ; 8, 16, 32)
   1 | a(16, ...) = (56, 56, 64, 80, 152, 232 ; 352, 144, 48, 32, 24, 40 ;
     |               56, 56, 64, 80, 152, 232)
   2 | a(34, ...) = (352, 216, 168, 176, 272, 360, 496, 448, 536, 664, 1168, 1488 ;
     |               2000, 768, 304, 336, 264, 192, 112, 120, 128, 112, 168, 240 ;
     |               352, 216, 168, 176, 272, 360, 496, 448, 536, 664, 1168, 1488)
   3 | a(70, ...) = (2000, 984, ... ; 10576, 4304, ... ; 2000, 984, ...)
   4 | a(142, ...) = (10576, 5016, ... ; 54328, 24120, ...; 10576, 5016, ...)
  etc. - _M. F. Hasler_, Dec 11 2018
		

Crossrefs

Programs

  • PARI
    A160161_vec(n)=(n=A160160_vec(n))-concat(0,n[^-1]) \\ M. F. Hasler, Dec 11 2018
    
  • PARI
    A160161_vec(n)={local(E=[Vecsmall([1,1,1])], s(U)=[Vecsmall(Vec(V)+U)|V<-E], J=[], M, A, B, U); [if(i>4,8*#E=setminus(setunion(A=s(U=matid(3)[i%3+1,]), B=select(vecmin,s(-U))), J=setunion(setunion(setintersect(A, B), E), J)),2^(i-1))|i<-[1..n]]} \\ Returns the vector a(1..n). (A160160 is actually given as partial sums of this sequence, rather than the converse.) - M. F. Hasler, Dec 12 2018

Formula

a(9*2^k - m) = a(6*2^k - m) for all k >= 0 and 2 <= m <= 3*2^(k-1) + 2. - M. F. Hasler, Dec 12 2018

Extensions

Extended to 78 terms with C++ program by R. J. Mathar, Jan 09 2010
Edited and extended by M. F. Hasler, Dec 11 2018

A110813 A triangle of pyramidal numbers.

Original entry on oeis.org

1, 3, 1, 5, 4, 1, 7, 9, 5, 1, 9, 16, 14, 6, 1, 11, 25, 30, 20, 7, 1, 13, 36, 55, 50, 27, 8, 1, 15, 49, 91, 105, 77, 35, 9, 1, 17, 64, 140, 196, 182, 112, 44, 10, 1, 19, 81, 204, 336, 378, 294, 156, 54, 11, 1, 21, 100, 285, 540, 714, 672, 450, 210, 65, 12, 1, 23, 121, 385, 825
Offset: 0

Views

Author

Paul Barry, Aug 05 2005

Keywords

Comments

Triangle A029653 less first column. In general, the product (1/(1-x),x/(1-x))*(1+m*x,x) yields the Riordan array ((1+(m-1)x)/(1-x)^2,x/(1-x)) with general term T(n,k)=(m*n-(m-1)*k+1)*C(n+1,k+1)/(n+1). This is the reversal of the (1,m)-Pascal triangle, less its first column. - Paul Barry, Mar 01 2006
The column sequences give, for k=0..10: A005408 (odd numbers), A000290 (squares), A000330, A002415, A005585, A040977, A050486, A053347, A054333, A054334, A057788.
Linked to Chebyshev polynomials by the fact that this triangle with interpolated zeros in the rows and columns is a scaled version of A053120.
Row sums are A033484. Diagonal sums are A001911(n+1) or F(n+4)-2. Factors as (1/(1-x),x/(1-x))*(1+2x,x). Inverse is A110814 or (-1)^(n-k)*A104709.
This triangle is a subtriangle of the [2,1] Pascal triangle A029653 (omit there the first column).
Subtriangle of triangles in A029653, A131084, A208510. - Philippe Deléham, Mar 02 2012
This is the iterated partial sums triangle of A005408 (odd numbers). Such iterated partial sums of arithmetic progression sequences have been considered by Narayana Pandit (see the Mar 20 2015 comment on A000580 where the MacTutor History of Mathematics archive link and the Gottwald et al. reference, p. 338, are given). - Wolfdieter Lang, Mar 23 2015

Examples

			The number triangle T(n, k) begins
n\k  0   1   2   3    4    5    6   7   8  9 10 11
0:   1
1:   3   1
2:   5   4   1
3:   7   9   5   1
4:   9  16  14   6    1
5:  11  25  30  20    7    1
6:  13  36  55  50   27    8    1
7:  15  49  91 105   77   35    9   1
8:  17  64 140 196  182  112   44  10   1
9:  19  81 204 336  378  294  156  54  11  1
10: 21 100 285 540  714  672  450 210  65 12  1
11: 23 121 385 825 1254 1386 1122 660 275 77 13  1
... reformatted by _Wolfdieter Lang_, Mar 23 2015
As a number square S(n, k) = T(n+k, k), rows begin
  1,   1,   1,   1,   1,   1, ...
  3,   4,   5,   6,   7,   8, ...
  5,   9,  14,  20,  27,  35, ...
  7,  16,  30,  50,  77, 112, ...
  9,  25,  55, 105, 182, 294, ...
		

Crossrefs

Programs

  • Mathematica
    Table[2*Binomial[n + 1, k + 1] - Binomial[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* G. C. Greubel, Oct 19 2017 *)
  • PARI
    for(n=0,10, for(k=0,n, print1(2*binomial(n+1, k+1) - binomial(n,k), ", "))) \\ G. C. Greubel, Oct 19 2017

Formula

Number triangle T(n, k) = C(n, k)*(2n-k+1)/(k+1) = 2*C(n+1, k+1) - C(n, k); Riordan array ((1+x)/(1-x)^2, x/(1-x)); As a number square read by antidiagonals, T(n, k)=C(n+k, k)(2n+k+1)/(k+1).
Equals A007318 * an infinite bidiagonal matrix with 1's in the main diagonal and 2's in the subdiagonal. - Gary W. Adamson, Dec 01 2007
Binomial transform of an infinite lower triangular matrix with all 1's in the main diagonal, all 2's in the subdiagonal and the rest zeros. - Gary W. Adamson, Dec 12 2007
T(n,k) = 2*T(n-1,k) + T(n-1,k-1) - T(n-2,k) - T(n-2,k-1), T(0,0)=T(1,1)=1, T(1,0)=3, T(n,k)=0 if k<0 or if k>n. - Philippe Deléham, Nov 30 2013
exp(x) * e.g.f. for row n = e.g.f. for diagonal n. For example, for n = 3 we have exp(x)*(7 + 9*x + 5*x^2/2! + x^3/3!) = 7 + 16*x + 30*x^2/2! + 50*x^3/3! + 77*x^4/4! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1 - x) ). - Peter Bala, Dec 21 2014
T(n, k) = ps(1, 2; k, n-k) with ps(a, d; k, n) = sum(ps(a, d; k-1, j), j=0..n) and input ps(a, d; 0, j) = a + d*j. See the iterated partial sums comment from Mar 23 2015 above. - Wolfdieter Lang, Mar 23 2015
From Franck Maminirina Ramaharo, May 21 2018: (Start)
T(n,k) = coefficients in the expansion of ((x + 2)*(x + 1)^n - 2)/x.
T(n,k) = A135278(n,k) + A135278(n-1,k).
T(n,k) = A097207(n,n-k).
G.f.: (y + 1)/((y - 1)*(x*y + y - 1)).
E.g.f.: ((x + 2)*exp(x*y + y) - 2*exp(y))/x.
(End)

A131128 Binomial transform of [1, 1, 5, 1, 5, 1, 5, ...].

Original entry on oeis.org

1, 2, 8, 20, 44, 92, 188, 380, 764, 1532, 3068, 6140, 12284, 24572, 49148, 98300, 196604, 393212, 786428, 1572860, 3145724, 6291452, 12582908, 25165820, 50331644, 100663292, 201326588, 402653180, 805306364, 1610612732, 3221225468
Offset: 0

Views

Author

Gary W. Adamson, Jun 16 2007

Keywords

Comments

Row sums of triangle A131129. - Emeric Deutsch, Jun 19 2007
For n >= 4, a(n) is the number of vertices in the dendrimer nanostar NS1[n-3] defined pictorially in the Ashrafi et al. reference (Ns1[3] is shown in Fig. 1) or in the Ahmadi et al. reference (Fig. 1). - Emeric Deutsch, May 17 2018

Examples

			a(3) = 20 = (1, 3, 3, 1) dot (1, 1, 5, 1) = (1 + 3 + 15 + 1).
		

References

  • B. Monjardet, Acyclic domains of linear orders: a survey, in "The Mathematics of Preference, Choice and Order: Essays in Honor of Peter Fishburn", edited by Steven Brams, William V. Gehrlein and Fred S. Roberts, Springer, 2009, pp. 139-160. [From N. J. A. Sloane, Feb 07 2009]

Crossrefs

Programs

  • GAP
    Concatenation([1],List([1..30], n->3*2^n-4)); # Muniru A Asiru, May 17 2018
  • Maple
    1, seq(3*2^n-4, n = 1 .. 30); # Emeric Deutsch, Jun 19 2007
  • Mathematica
    CoefficientList[Series[(1-x+4x^2)/((1-x)(1-2x)),{x,0,40}],x] (* Vincenzo Librandi, Apr 11 2012 *)

Formula

a(n) = 3*2^n - 4 for n >= 1; a(0)=1. Formula follows by replacing [1,1,5,1,5,1,...] with [1,3-2,3+2,3-2,3+2,3-2,...]. - Emeric Deutsch, Jun 19 2007
G.f.: (1 - x + 4x^2)/((1-x)(1-2x)). - Emeric Deutsch, Jul 09 2007
Row sums of triangle A132047. - Gary W. Adamson, Aug 08 2007
a(n) = 2*a(n-1) + 4 for n >= 2, a(0)=1, a(1)=2. - Philippe Deléham, Sep 23 2009
a(n) = 2*A033484(n-1) for n>0. - R. J. Mathar, Feb 27 2019

A198060 Array read by antidiagonals, m>=0, n>=0, A(m,n) = Sum_{k=0..n} Sum_{j=0..m} Sum_{i=0..m} (-1)^(j+i)*C(i,j)*C(n,k)^(m+1)*(n+1)^j*(k+1)^(-j).

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 1, 4, 10, 8, 1, 5, 22, 35, 16, 1, 6, 46, 134, 126, 32, 1, 7, 94, 485, 866, 462, 64, 1, 8, 190, 1700, 5626, 5812, 1716, 128, 1, 9, 382, 5831, 35466, 69062, 40048, 6435, 256, 1, 10, 766, 19682, 219626, 795312, 882540, 281374, 24310, 512
Offset: 0

Views

Author

Peter Luschny, Nov 01 2011

Keywords

Comments

We repeat the definition of a meander as given in the link below and used in the sequences in the cross-references:
A binary curve C is a triple (m, S, dir) such that:
(a) S is a list with values in {L, R} which starts with an L,
(b) dir is a list of m different values, each value of S being allocated a value of dir,
(c) consecutive Ls increment the index of dir,
(d) consecutive Rs decrement the index of dir,
(e) the integer m > 0 divides the length of S.
(f) C is a meander if each value of dir occurs length(S) / m times.
The rows of the array A(m, n) show the number of meanders of length n and central angle 360/m as specified by the columns of a table in the given link. - Peter Luschny, Mar 20 2023

Examples

			Array A(m, k) starts:
  m\n  [0] [1]  [2]   [3]     [4]     [5]        [6]
  --------------------------------------------------
  [0]   1   2    4     8      16       32         64   A000079
  [1]   1   3   10    35     126      462       1716   A001700
  [2]   1   4   22   134     866     5812      40048   A197657
  [3]   1   5   46   485    5626    69062     882540   A198256
  [4]   1   6   94  1700   35466   795312   18848992   A198257
  [5]   1   7  190  5831  219626  8976562  394800204   A198258
Triangle T(m, k) starts:
  [0]   1;
  [1]   2,    1;
  [2]   4,    3,    1;
  [3]   8,   10,    4,    1;
  [4]  16,   35,   22,    5,    1;
  [5]  32,  126,  134,   46,    6,   1;
  [6]  64,  462,  866,  485,   94,   7, 1;
  [7] 128, 1716, 5812, 5626, 1700, 190, 8, 1;
Using the representation of meanders as multiset permutations (see A361043) and generated by the Julia program below.
  T(3, 0) =  8 = card(1000, 1100, 1010, 1001, 1110, 1101, 1011, 1111).
  T(3, 1) = 10 = card(110000, 100100, 100001, 111100, 111001, 110110, 110011, 101101, 100111, 111111).
  T(3, 2) =  4 = card(111000, 110001, 100011, 111111).
  T(3, 3) =  1 = card(1111).
		

Crossrefs

Programs

  • Julia
    using Combinatorics
    function isMeander(m::Int, c::Vector{Bool})::Bool
        l = length(c)
        (l == 0 || c[1] != true) && return false
        vec = fill(Int(0), m)
        max = div(l, m)
        dir = Int(1)
        ob = c[1]
        for b in c
            if b && ob
                dir += 1
            elseif !b && !ob
                dir -= 1
            end
            dir = mod(dir, m)
            v = vec[dir + 1] + 1
            vec[dir + 1] = v
            if v > max
                return false
            end
            ob = b
        end
    true end
    function CountMeanders(n, k)
        n == 0 && return k + 1
        count = 0
        size = n * k
        for a in range(0, stop=size; step=n)
            S = [(i <= a) for i in 1:size]
            count += sum(1 for c in multiset_permutations(S, size)
                         if isMeander(n, c); init = 0)
        end
    count end
    A198060ByCount(m, n) = CountMeanders(m + 1, n + 1)
    for n in 0:4
        [A198060ByCount(n, k) for k in 0:4] |> println
    end
    # Peter Luschny, Mar 20 2023
  • Maple
    A198060 := proc(m, n) local i, j, k; add(add(add((-1)^(j+i)*binomial(i, j)* binomial(n, k)^(m+1)*(n+1)^j*(k+1)^(-j), i=0..m), j=0..m), k=0..n) end:
    for m from 0 to 6 do seq(A198060(m, n), n=0..6) od;
  • Mathematica
    a[m_, n_] := Sum[ Sum[ Sum[(-1)^(j + i)*Binomial[i, j]*Binomial[n, k]^(m+1)*(n+1)^j*(k+1)^(m-j)/(k+1)^m, {i, 0, m}], {j, 0, m}], {k, 0, n}]; Table[ a[m-n, n], {m, 0, 9}, {n, 0, m}] // Flatten (* Jean-François Alcover, Jun 27 2013 *)
  • SageMath
    # This function assumes an offset (1, 1).
    def A(m: int, n: int) -> int:
        S = sum(
                sum(
                    sum((
                        (-1) ** (j + i)
                        * binomial(i, j)
                        * binomial(n - 1, k) ** m
                        * n ** j )
                        // (k + 1) ** j
                    for i in range(m) )
                for j in range(m) )
            for k in range(n) )
        return S
    def Arow(n: int, size: int) -> list[int]:
        return [A(n, k) for k in range(1, size + 1)]
    for n in range(1, 7): print([n], Arow(n, 7)) # Peter Luschny, Mar 24 2023
    # These functions compute the number of meanders by generating and counting.
    # Their primary purpose is to illustrate that meanders are a special class of
    # multiset permutations. They are not suitable for numerical calculation.
    

Formula

From Peter Bala, Apr 22 2022: (Start)
Conjectures:
1) the m-th row entries satisfy the Gauss congruences T(m, n*p^r - 1) == T(m, n*p^(r-1) - 1) (mod p^r) for primes p >= 3 and positive integers n and r.
2) for m even, the m-th row entries satisfy the congruences T(m, p^r - 1) == 2^(p^r - 1) (mod p^2) for primes p >= 3 and positive integers r.
3) for m odd, the m-th row entries satisfy the supercongruences T(m,n*p^r - 1) == T(m,n*p*(r-1) - 1) (mod p^(3*r)) for primes p >= 5 and positive integers n and r. (End)

A007179 Dual pairs of integrals arising from reflection coefficients.

Original entry on oeis.org

0, 1, 1, 4, 6, 16, 28, 64, 120, 256, 496, 1024, 2016, 4096, 8128, 16384, 32640, 65536, 130816, 262144, 523776, 1048576, 2096128, 4194304, 8386560, 16777216, 33550336, 67108864, 134209536, 268435456, 536854528, 1073741824, 2147450880, 4294967296, 8589869056
Offset: 0

Views

Author

Keywords

Examples

			From _Gus Wiseman_, Feb 26 2022: (Start)
Also the number of integer compositions of n with at least one odd part. For example, the a(1) = 1 through a(5) = 16 compositions are:
  (1)  (1,1)  (3)      (1,3)      (5)
              (1,2)    (3,1)      (1,4)
              (2,1)    (1,1,2)    (2,3)
              (1,1,1)  (1,2,1)    (3,2)
                       (2,1,1)    (4,1)
                       (1,1,1,1)  (1,1,3)
                                  (1,2,2)
                                  (1,3,1)
                                  (2,1,2)
                                  (2,2,1)
                                  (3,1,1)
                                  (1,1,1,2)
                                  (1,1,2,1)
                                  (1,2,1,1)
                                  (2,1,1,1)
                                  (1,1,1,1,1)
(End)
		

References

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

Crossrefs

Column k=2 of A309748.
Odd bisection is A000302.
Even bisection is A006516 = 2^(n-1)*(2^n - 1).
The complement is counted by A077957, internal version A027383.
The internal case is A274230, even bisection A134057.
A000045(n-1) counts compositions without odd parts, non-singleton A077896.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A034871, A097805, and A345197 count compositions by alternating sum.
A052952 (or A074331) counts non-singleton compositions without even parts.

Programs

  • Magma
    [Floor(2^n/2-2^(n/2)*(1+(-1)^n)/4): n in [0..40]]; // Vincenzo Librandi, Aug 20 2011
    
  • Maple
    f := n-> if n mod 2 = 0 then 2^(n-1)-2^((n-2)/2) else 2^(n-1); fi;
  • Mathematica
    LinearRecurrence[{2,2,-4},{0,1,1},30] (* Harvey P. Dale, Nov 30 2015 *)
    Table[2^(n-1)-If[EvenQ[n],2^(n/2-1),0],{n,0,15}] (* Gus Wiseman, Feb 26 2022 *)
  • PARI
    Vec(x*(1-x)/((1-2*x)*(1-2*x^2)) + O(x^50)) \\ Michel Marcus, Jan 28 2016

Formula

From Paul Barry, Apr 28 2004: (Start)
Binomial transform is (A000244(n)+A001333(n))/2.
G.f.: x*(1-x)/((1-2*x)*(1-2*x^2)).
a(n) = 2*a(n-1)+2*a(n-2)-4*a(n-3).
a(n) = 2^n/2-2^(n/2)*(1+(-1)^n)/4. (End)
G.f.: (1+x*Q(0))*x/(1-x), where Q(k)= 1 - 1/(2^k - 2*x*2^(2*k)/(2*x*2^k - 1/(1 + 1/(2*2^k - 8*x*2^(2*k)/(4*x*2^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013
a(n) = A011782(n+2) - A077957(n) - Gus Wiseman, Feb 26 2022

A112739 Array counting nodes in rooted trees of height n in which the root and internal nodes have valency k (and the leaf nodes have valency one).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 4, 5, 2, 1, 1, 5, 10, 7, 2, 1, 1, 6, 17, 22, 9, 2, 1, 1, 7, 26, 53, 46, 11, 2, 1, 1, 8, 37, 106, 161, 94, 13, 2, 1, 1, 9, 50, 187, 426, 485, 190, 15, 2, 1, 1, 10, 65, 302, 937, 1706, 1457, 382, 17, 2, 1, 1, 11, 82, 457, 1814, 4687, 6826, 4373, 766, 19
Offset: 0

Views

Author

Paul Barry, Sep 16 2005

Keywords

Comments

Rows of the square array have g.f. (1+x)/((1-x)(1-kx)). They are the partial sums of the coordination sequences for the infinite tree of valency k. Row sums are A112740.
Rows of the square array are successively: A000012, A040000, A005408, A033484, A048473, A020989, A057651, A061801, A238275, A238276, A138894, A090843, A199023. - Philippe Deléham, Feb 22 2014

Examples

			As a square array, rows begin
1,1,1,1,1,1,... (A000012)
1,2,2,2,2,2,... (A040000)
1,3,5,7,9,11,... (A005408)
1,4,10,22,46,94,... (A033484)
1,5,17,53,161,485,... (A048473)
1,6,26,106,426,1706,... (A020989)
1,7,37,187,937,4687,... (A057651)
1,8,50,302,1814,10886,... (A061801)
As a number triangle, rows start
1;
1,1;
1,2,1;
1,3,2,1;
1,4,5,2,1;
1,5,10,7,2,1;
		

References

  • L. He, X. Liu and G. Strang, (2003) Trees with Cantor Eigenvalue Distribution. Studies in Applied Mathematics 110 (2), 123-138.
  • L. He, X. Liu and G. Strang, Laplacian eigenvalues of growing trees, Proc. Conf. on Math. Theory of Networks and Systems, Perpignan (2000).

Crossrefs

Formula

As a square array read by antidiagonals, T(n, k)=sum{j=0..k, (2-0^j)*(n-1)^(k-j)}; T(n, k)=(n(n-1)^k-2)/(n-2), n<>2, T(2, n)=2n+1; T(n, k)=sum{j=0..k, (n(n-1)^j-0^j)/(n-1)}, j<>1. As a triangle read by rows, T(n, k)=if(k<=n, sum{j=0..k, (2-0^j)*(n-k-1)^(k-j)}, 0).

A048483 Array read by antidiagonals: T(k,n) = (k+1)2^n - k.

Original entry on oeis.org

1, 2, 1, 4, 3, 1, 8, 7, 4, 1, 16, 15, 10, 5, 1, 32, 31, 22, 13, 6, 1, 64, 63, 46, 29, 16, 7, 1, 128, 127, 94, 61, 36, 19, 8, 1, 256, 255, 190, 125, 76, 43, 22, 9, 1, 512, 511, 382, 253, 156, 91, 50, 25, 10, 1, 1024, 1023, 766, 509, 316, 187
Offset: 0

Views

Author

Keywords

Comments

n-th difference of (T(k,n),T(k,n-1),...,T(k,0)) is k+1, for n=1,2,3,...; k=0,1,2,...

Examples

			1 2 4 8 16 32 ...
1 3 7 15 31 63 ...
1 4 10 22 46 94 ...
1 5 13 29 61 125 ...
1 6 16 36 76 156 ...
		

Crossrefs

Rows are A000079 (k=0), A000225 (k=1), A033484 (k=2), A036563 (k=3), A048487 (k=4), A048488 (k=5), A048489 (k=6), A048490 (k=7), A048491 (k=8).
Main diagonal is A048493. Cf. A048494.

Formula

G.f.: (1-x+kx)/[(1-x)(1-2x)]. E.g.f.: (k+1)*exp(2x) - k*exp(x).
Recurrences: T(k, n) = 2T(k, n-1)+k = T(k-1, n)+2^n-1, T(k, 0) = 1.

Extensions

Edited by Ralf Stephan, Feb 05 2004

A101946 a(n) = 6*2^n - 3*n - 5.

Original entry on oeis.org

1, 4, 13, 34, 79, 172, 361, 742, 1507, 3040, 6109, 12250, 24535, 49108, 98257, 196558, 393163, 786376, 1572805, 3145666, 6291391, 12582844, 25165753, 50331574, 100663219, 201326512, 402653101, 805306282, 1610612647, 3221225380, 6442450849, 12884901790
Offset: 0

Views

Author

Gary W. Adamson, Dec 22 2004

Keywords

Comments

Sequence generated from a 3 X 3 matrix, companion to A101945.
Characteristic polynomial of M = x^3 - 4x^2 + 5x - 2.
Sequence can also be generated by the same method as A061777 with slightly different rules. Refer to A061777, which is the "vertex to vertex" expansion version. For this case, the expandable vertices of the existing generation will contact the sides of the new ones, i.e., "vertex to side" expansion version. Let us assign the label "1" to the triangle at the origin; at n-th generation add a triangle at each expandable vertex, i.e., each vertex where the added generations will not overlap the existing ones, although overlaps among new generations are allowed. The non-overlapping triangles will have the same label value as a predecessor; for the overlapping ones, the label value will be sum of label values of predecessors. a(n) is the sum of all label values at n-th generation. The triangles count is A005448. See illustration. - Kival Ngaokrajang, Sep 26 2014
The number of ways to select 0 or more nodes of a 2 X n rectangular grid such that the selected nodes are connected, but do not fill any 2 X 2 square. This question arises in logic puzzles such as Nurikabe. - Hugo van der Sanden, Feb 22 2024

Examples

			a(4) = 79 = 4*34 - 5*13 + 2*4 = 4*a(3) - 5*a(2) + 2*a(1).
a(4) = right term in M^4 * [1 1 1], since M^4 * [1 1 1] = [1 46 a(4)], where 46 = A033484(4).
		

Crossrefs

Programs

  • Magma
    [6*2^n -3*n-5: n in [0..40]]; // G. C. Greubel, Feb 06 2022
    
  • Mathematica
    a[0]=1; a[1]=4; a[2]=13; a[n_]:= a[n]= 4a[n-1] -5a[n-2] +2a[n-3]; Table[ a[n], {n, 0, 30}] (* Or *)
    a[n_] := (MatrixPower[{{1, 0, 0}, {2, 2, 0}, {1, 2, 1}}, n].{{1}, {1}, {1}})[[3, 1]]; Table[ a[n], {n, 0, 30}] (* Robert G. Wilson v, Jan 12 2005 *)
    Table[6*2^n-3n-5,{n,0,40}] (* or *) LinearRecurrence[{4,-5,2},{1,4,13},40] (* Harvey P. Dale, Jun 03 2017 *)
  • PARI
    a(n) = if (n<1, 1, 5*(2^n-1)+a(n-1))\\ Kival Ngaokrajang, Sep 26 2014
    
  • PARI
    Vec(-(2*x^2+1)/((x-1)^2*(2*x-1)) + O(x^100)) \\ Colin Barker, Sep 26 2014
    
  • Sage
    [3*(2^(n+1) -n-2) +1 for n in (0..40)] # G. C. Greubel, Feb 06 2022

Formula

a(0)=1, a(1)=4, a(2)=13 and for n>2, a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3).
a(n) = right term in M^n * [1 1 1], where M = the 3X3 matrix [1 0 0 / 2 2 0 / 1 2 1]. M^n * [1 1 1] = [1 A033484(n) a(n)].
a(0) = 1, for n >= 1, a(n) = 3*A000225(n) + a(n-1). - Kival Ngaokrajang, Sep 26 2014
G.f.: (1+2*x^2)/((1-x)^2*(1-2*x)). - Colin Barker, Sep 26 2014
E.g.f.: 6*exp(2*x) - (5+3*x)*exp(x). - G. C. Greubel, Feb 06 2022

Extensions

New definition from Ralf Stephan, May 17 2007
Previous Showing 11-20 of 72 results. Next