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

A120443 Number of (undirected) Hamiltonian paths in the n X n grid graph.

Original entry on oeis.org

1, 4, 20, 276, 4324, 229348, 13535280, 3023313284, 745416341496, 730044829512632, 786671485270308848, 3452664855804347354220, 16652005717670534681315580, 331809088406733654427925292528, 7263611367960266490262600117251524
Offset: 1

Views

Author

David Bevan, Jul 19 2006

Keywords

Examples

			From _Robert FERREOL_, Apr 03 2019: (Start)
a(3) = 20:
there are 4 paths similar to
  + - + - +
          |
  + - + - +
  |
  + - + - +
8 paths similar to
  + - + - +
  |       |
  +   + - +
  |   |
  +   + - +
and 8 paths similar to
  + - + - +
  |       |
  +   +   +
  |   |   |
  +   + - +
(End)
		

Crossrefs

Formula

a(n) = A096969(n) / 2 for n > 1.

Extensions

More terms from Jesper L. Jacobsen (jesper.jacobsen(AT)u-psud.fr), Dec 12 2007

A332307 Array read by antidiagonals: T(m,n) is the number of (undirected) Hamiltonian paths in the m X n grid graph.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 8, 8, 1, 1, 14, 20, 14, 1, 1, 22, 62, 62, 22, 1, 1, 32, 132, 276, 132, 32, 1, 1, 44, 336, 1006, 1006, 336, 44, 1, 1, 58, 688, 3610, 4324, 3610, 688, 58, 1, 1, 74, 1578, 12010, 26996, 26996, 12010, 1578, 74, 1, 1, 92, 3190, 38984, 109722, 229348, 109722, 38984, 3190, 92, 1
Offset: 1

Views

Author

Andrew Howroyd, Feb 09 2020

Keywords

Examples

			Array begins:
================================================
m\n | 1  2   3     4      5       6        7
----+-------------------------------------------
  1 | 1  1   1     1      1       1        1 ...
  2 | 1  4   8    14     22      32       44 ...
  3 | 1  8  20    62    132     336      688 ...
  4 | 1 14  62   276   1006    3610    12010 ...
  5 | 1 22 132  1006   4324   26996   109722 ...
  6 | 1 32 336  3610  26996  229348  1620034 ...
  7 | 1 44 688 12010 109722 1620034 13535280 ...
  ...
		

Crossrefs

Formula

T(n,m) = T(m,n).

A181688 Number of maximal self-avoiding walks from NW to SW corners of a 4-by-n grid.

Original entry on oeis.org

1, 1, 4, 8, 23, 55, 144, 360, 921, 2329, 5924, 15024, 38159, 96847, 245888, 624176, 1584593, 4022609, 10211940, 25924088, 65811431, 167069767, 424126160, 1076693080, 2733310377, 6938824361, 17615009476, 44717740000, 113521160607, 288186606623
Offset: 1

Views

Author

Sean A. Irvine, Nov 17 2010

Keywords

Examples

			Illustration of a(1)=a(2)=1:
   .    .__.
   |    .__|
   |    |__
   |    .__|
Illustration of a(3)=4:
   .__.__.    .  .__.    .  .__.    .__.__.
   .__.__|    |__|  |    |  |  |    .__.  |
   |__.__.    .__.  |    |__|  |    |  |  |
   .__.__|    |  |__|    .__.__|    |  |__|
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{2, 2, -2, 1}, {1, 1, 4, 8}, 30] (* T. D. Noe, Nov 06 2013 *)

Formula

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

Extensions

G.f. formula reverted to the original (correct) value by Stefan Bühler, Nov 06 2013

A339762 Number of (undirected) Hamiltonian paths in the 4 X n king graph.

Original entry on oeis.org

1, 208, 4678, 171592, 4743130, 132202038, 3461461060, 88405359072, 2197293738684, 53565801482634, 1284136961473864, 30365618160010650, 709700882866473654, 16422374051280905778, 376744989106882359402, 8578133199326578887346, 194030408441913214687458
Offset: 1

Views

Author

Seiichi Manyama, Dec 16 2020

Keywords

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_nXk_king_graph(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
                if i < k:
                    grids.append((i + (j - 1) * k, i + j * k + 1))
                if i > 1:
                    grids.append((i + (j - 1) * k, i + j * k - 1))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
        return grids
    def A(start, goal, n, k):
        universe = make_nXk_king_graph(n, k)
        GraphSet.set_universe(universe)
        paths = GraphSet.paths(start, goal, is_hamilton=True)
        return paths.len()
    def B(n, k):
        m = k * n
        s = 0
        for i in range(1, m):
            for j in range(i + 1, m + 1):
                s += A(i, j, n, k)
        return s
    def A339762(n):
        return B(n, 4)
    print([A339762(n) for n in range(1, 11)])

A014524 Number of Hamiltonian paths from NW to SW corners in a grid with 2n rows and 4 columns.

Original entry on oeis.org

0, 1, 8, 47, 264, 1480, 8305, 46616, 261663, 1468752, 8244304, 46276385, 259755560, 1458042831, 8184190168, 45938958232, 257861540369, 1447411446840, 8124514782015, 45603992276896, 255981331487648
Offset: 0

Views

Author

Keywords

Examples

			Illustration of a(1)=1:
   .__.__.__.
   .__.__.__|
Illustration of a few of the 8 solutions to a(2):
   .__.__.__.    .  .__.__.    .  .__.__.    .__.__.__.
   .__.__.  |    |  |  .__|    |__|  .__|    .__.__.__|
   |__   |  |    |__|  |__.    .__.  |__.    |__.__.__.
   .__|  |__|    .__.__.__|    |  |__.__|    .__.__.__|
		

Crossrefs

Even bisection of column 4 of A271592.

Programs

  • Mathematica
    CoefficientList[Series[x (x + 1)/(x^4 - 7 x^3 + 9 x^2 - 7 x + 1), {x, 0, 50}], x] (* Vincenzo Librandi, Oct 15 2013 *)

Formula

From Colin Barker, May 20 2013: (Start)
a(n) = 7*a(n-1)-9*a(n-2)+7*a(n-3)-a(n-4).
G.f.: x*(x+1)/(x^4-7*x^3+9*x^2-7*x+1). (End)

Extensions

Name clarified by Andrew Howroyd, Apr 10 2016

A339798 Number of (undirected) Hamiltonian paths in the graph C_4 X C_n.

Original entry on oeis.org

4128, 45696, 287160, 2172480, 11866848, 76468352, 390714840, 2301083680, 11288784144, 62812654272, 299720429528, 1604776566400, 7505573487360, 39105991164160, 180179056818584, 920223907284960, 4191443432295472, 21088555826121280, 95195388883597464, 473503955161244480
Offset: 3

Views

Author

Seiichi Manyama, Dec 17 2020

Keywords

Crossrefs

Programs

  • Python
    # Using graphillion
    from graphillion import GraphSet
    def make_CnXCk(n, k):
        grids = []
        for i in range(1, k + 1):
            for j in range(1, n):
                grids.append((i + (j - 1) * k, i + j * k))
            grids.append((i + (n - 1) * k, i))
        for i in range(1, k * n, k):
            for j in range(1, k):
                grids.append((i + j - 1, i + j))
            grids.append((i + k - 1, i))
        return grids
    def A(start, goal, n, k):
        universe = make_CnXCk(n, k)
        GraphSet.set_universe(universe)
        paths = GraphSet.paths(start, goal, is_hamilton=True)
        return paths.len()
    def B(n, k):
        m = k * n
        s = 0
        for i in range(1, m):
            for j in range(i + 1, m + 1):
                s += A(i, j, n, k)
        return s
    def A339798(n):
        return B(n, 4)
    print([A339798(n) for n in range(3, 10)])
Showing 1-6 of 6 results.