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.

User: Steven Klee

Steven Klee's wiki page.

Steven Klee has authored 5 sequences.

A330601 Array T read by antidiagonals: T(m,n) is the number of lattice walks from (0,0) to (m,n) using one step from {(3,0), (2,1), (1,2), (0,3)} and all other steps from {(1,0), (0,1)}.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 4, 4, 4, 2, 3, 9, 12, 12, 9, 3, 4, 16, 28, 32, 28, 16, 4, 5, 25, 55, 75, 75, 55, 25, 5, 6, 36, 96, 156, 180, 156, 96, 36, 6, 7, 49, 154, 294, 392, 392, 294, 154, 49, 7, 8, 64, 232, 512, 784, 896, 784, 512, 232, 64, 8, 9, 81, 333, 837, 1458, 1890, 1890, 1458, 837, 333, 81, 9
Offset: 0

Author

Steven Klee, Dec 19 2019

Keywords

Examples

			For (m,n) = (3,1), there are T(3,1) = 4 paths:
(3,0), (0,1)
(0,1), (3,0)
(2,1), (1,0)
(1,0), (2,1).
Array T(m,n) begins
n/m 0   1    2     3     4      5      6      7       8       9
0   0   0    0     1     2      3      4      5       6       7
1   0   0    1     4     9     16     25     36      49      64
2   0   1    4    12    28     55     96    154     232     333
3   1   4   12    32    75    156    294    512     837    1300
4   2   9   28    75   180    392    784   1458    2550    4235
5   3  16   55   156   392    896   1890   3720    6897   12144
6   4  25   96   294   784   1890   4200   8712   17028   31603
7   5  36  154   512  1458   3720   8712  19008   39039   76076
8   6  49  232   837  2550   6897  17028  39039   84084  171600
9   7  64  333  1300  4235  12144  31603  76076  171600  366080
		

Crossrefs

T(m,0) is A000027 for m >= 2.
T(m,1) is A000290 for m >= 1.
T(m,2) is A006000.

Programs

  • Sage
    def T(m,n):
        return (m+n-2)*(binomial(m+n-2, m) + binomial(m+n-2, n))

Formula

T(m,n) = (m+n-2)*(binomial(m+n-2,m) + binomial(m+n-2,n)).

A292437 a(n) is the number of lattice walks from (0,0) to (3*n,3*n) that use steps in directions {(3,0), (2,1), (1,2), (0,3)} and stay weakly below the line y=x.

Original entry on oeis.org

1, 2, 13, 120, 1288, 15046, 185658, 2380720, 31411376, 423660504, 5814905977, 80956085304, 1140478875656, 16227516683124, 232870988052180, 3366482778363616, 48981220255732960, 716707681487535144, 10539913681632290532, 155697664218428455520, 2309297999296926348448
Offset: 0

Author

Steven Klee, Dec 08 2017

Keywords

Examples

			For n=2, the a(2)=13 paths terminating at (6,6) are
(3, 0), (3, 0), (0, 3), (0, 3)
(3, 0), (2, 1), (1, 2), (0, 3)
(3, 0), (2, 1), (0, 3), (1, 2)
(3, 0), (1, 2), (2, 1), (0, 3)
(3, 0), (1, 2), (1, 2), (1, 2)
(3, 0), (0, 3), (3, 0), (0, 3)
(3, 0), (0, 3), (2, 1), (1, 2)
(2, 1), (3, 0), (1, 2), (0, 3)
(2, 1), (3, 0), (0, 3), (1, 2)
(2, 1), (2, 1), (2, 1), (0, 3)
(2, 1), (2, 1), (1, 2), (1, 2)
(2, 1), (1, 2), (3, 0), (0, 3)
(2, 1), (1, 2), (2, 1), (1, 2)
		

Crossrefs

Programs

  • Maple
    b:= proc(l) option remember; `if`(l=[0$2], 1, add(
          (f-> `if`(min(f)<0 or f[1] b([3*n$2]):
    seq(a(n), n=0..25);  # Alois P. Heinz, Dec 09 2017
  • Mathematica
    b[l_] := b[l] = If[l == {0, 0}, 1, Sum[Function[f, If[Min[f] < 0 || f[[1]] < f[[2]], 0, b[f]]][l - g], {g, {{3, 0}, {2, 1}, {1, 2}, {0, 3}}}]];
    a[n_] := b[{3n, 3n}];
    a /@ Range[0, 25] (* Jean-François Alcover, May 13 2020, after Alois P. Heinz *)
  • Sage
    S = [[3,0],[2,1],[1,2],[0,3]]
    q = 10
    numPathsMat = matrix(q+1,q+1,0)
    for m in [0..q]:
        for n in [0..m]:
            count = 0
            for s in S:
                if n-s[1]>=0 and m-s[0]>=n-s[1]:
                    count += numPathsMat[m-s[0],n-s[1]]
            numPathsMat[m,n] = count
            numPathsMat[0,0] = 1
    print(numPathsMat.diagonal())

A292436 Array T read by antidiagonals: T(m,n) is the number of lattice walks of minimal length from (0,0) to (m,n) using steps in directions from {(1,0), (0,1), (2,1), (1,2)}.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4, 2, 1, 1, 3, 9, 9, 3, 1, 1, 4, 1, 2, 1, 4, 1, 1, 5, 3, 9, 9, 3, 5, 1, 1, 6, 6, 24, 36, 24, 6, 6, 1, 1, 7, 10, 1, 3, 3, 1, 10, 7, 1, 1, 8, 15, 4, 16, 24, 16, 4, 15, 8, 1, 1, 9, 21, 10, 50, 100, 100, 50, 10, 21, 9, 1, 1, 10, 28, 20, 1, 4, 6, 4, 1, 20, 28, 10, 1
Offset: 0

Author

Steven Klee, Dec 08 2017

Keywords

Examples

			Array T(m,n) begins
n\m 0    1    2    3    4    5    6    7    8    9   10
0   1    1    1    1    1    1    1    1    1    1    1
1   1    2    1    2    3    4    5    6    7    8    9
2   1    1    4    9    1    3    6   10   15   21   28
3   1    2    9    2    9   24    1    4   10   20   35
4   1    3    1    9   36    3   16   50    1    5   15
5   1    4    3   24    3   24  100    4   25   90    1
6   1    5    6    1   16  100    6   50  225    5   36
7   1    6   10    4   50    4   50  300   10   90  441
8   1    7   15   10    1   25  225   10  120  735   15
9   1    8   21   20    5   90    5   90  735   20  245
10  1    9   28   35   15    1   36  441   15  245 1960
		

Crossrefs

Programs

  • Sage
    # For an implementation see A292435.

Formula

T(m,n) = binomial(m-n,n) for m>=2*n;
T(m,n) = binomial(q+r,r)*binomial(q+r,m-q) for 1/2*n<=m<=2*n, where m+n = 3*q+r with 0<=r<=2;
T(m,n) = binomial(n-m,m) for m<=1/2*n.

A292435 Array T read by antidiagonals: T(m,n) = number of lattice walks of minimal length from (0,0) to (m,n) using steps in directions from {(1,0), (0,1), (3,0), (2,1), (1,2), (0,3)}.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 4, 4, 4, 2, 3, 9, 12, 12, 9, 3, 1, 2, 3, 4, 3, 2, 1, 3, 9, 15, 21, 21, 15, 9, 3, 6, 24, 48, 72, 84, 72, 48, 24, 6, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 4, 16, 36, 64, 88, 96, 88, 64, 36, 16, 4, 10, 50, 130, 250, 380, 460, 460, 380, 250, 130, 50, 10, 1, 4, 10, 20, 31, 40, 44, 40, 31, 20, 10, 4, 1
Offset: 0

Author

Steven Klee, Dec 08 2017

Keywords

Examples

			Array T(m,n) begins
n\m    0     1     2     3     4     5     6     7     8     9    10
--------------------------------------------------------------------
[0]    1     1     1     1     2     3     1     3     6     1     4
[1]    1     2     1     4     9     2     9    24     3    16    50
[2]    1     1     4    12     3    15    48     6    36   130    10
[3]    1     4    12     4    21    72    10    64   250    20   150
[4]    2     9     3    21    84    12    88   380    31   255  1215
[5]    3     2    15    72    12    96   460    40   355  1830   101
[6]    1     9    48    10    88   460    44   420  2325   135  1416
[7]    3    24     6    64   380    40   420  2520   155  1740 11046
[8]    6     3    36   250    31   355  2325   155  1860 12600   546
[9]    1    16   130    20   255  1830   135  1740 12600   580  7882
[10]   4    50    10   150  1215   101  1416 11046   546  7882 63056
		

Crossrefs

Cf. A007318.

Programs

  • Sage
    S = [[1,0], [0,1], [3,0], [2,1], [1,2], [0,3]]
    q = 8 # q = range for m,n; change q for more data
    numPathsMat = matrix(q+1,q+1,0)
    distMatrix  = matrix(q+1,q+1,0)
    for m in [0..q]:
        for n in [0..q]:
            # first determine S-distance to (m,n)
            d = minNeighborDist = max(distMatrix.list()) + 1
            for s in S:
                if m-s[0]>=0 and n-s[1]>=0:
                    d = distMatrix[m-s[0],n-s[1]]
                if d < minNeighborDist:
                    minNeighborDist=d
            distMatrix[m,n] = minNeighborDist+1
            # next count number of minimal S-paths
            count = 0
            for s in S:
                if m-s[0]>=0 and n-s[1]>=0:
                    if distMatrix[m-s[0],n-s[1]]==distMatrix[m,n]-1:
                        count += numPathsMat[m-s[0],n-s[1]]
            numPathsMat[m,n] = count
            numPathsMat[0,0] = 1
    print(numPathsMat)

Formula

G.f.: Sum(T(m,n)*x^m*y^n,m>=0,n>=0) = Sum(binomial(q+r,r)*(x^3+x^2*y+x*y^2+y^3)^q*(x+y)^r,q>=0,0<=r<=2).

A167406 Sequence a(n) gives the number of ways to seat 2n people around a circular table so that person i does not sit across from person n+i for any 1 <= i <= n.

Original entry on oeis.org

0, 4, 64, 2880, 208896, 23193600, 3640688640, 768126320640, 209688566169600, 71921062285148160, 30278182590480384000, 15350836256712740044800, 9225766813653105691852800, 6485670333458406942179328000, 5272823572160895949091320627200
Offset: 1

Author

Steven Klee (klees(AT)math.washington.edu), Nov 03 2009

Keywords

Examples

			When n=2, there are four people seated around a circular table. Person 1 can sit across from either person 2 or person 4, and person 3 can sit either to the left or to the right of person 1. Thus a(2) = 2*2=4.
		

Programs

  • PARI
    a(n) = n!^2/(2*n)*sum(k = 0,n+1,(-1)^k/k!*binomial(2*n-2*k, n-k)*2^k) \\ Michel Marcus, Jul 11 2013

Formula

a(n) = (n!)^2/(2*n)*sum{k = 0..n+1}((-1)^k/k!*binomial(2*n-2*k, n-k)*2^k).

Extensions

More terms from Michel Marcus, Jul 11 2013