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

A317949 Erroneous version of A013582.

Original entry on oeis.org

1, 4, 25, 124, 574, 2156, 8258
Offset: 0

Views

Author

Keywords

Comments

These incorrect values were listed in A013582 from about 1996 to 2018.
Included in accordance with OEIS policy of including published but incorrect versions of sequences.

A212693 Number of legal 7 X 6 Connect-Four positions after n plies.

Original entry on oeis.org

1, 7, 49, 238, 1120, 4263, 16422, 54859, 184275, 558186, 1662623, 4568683, 12236101, 30929111, 75437595, 176541259, 394591391, 858218743, 1763883894, 3568259802, 6746155945, 12673345045, 22010823988, 38263228189, 60830813459, 97266114959, 140728569039
Offset: 0

Views

Author

John Tromp, May 23 2012

Keywords

Comments

Sum of all 43 terms is 4531985219092 as computed by Edelkamp and Kissmann (see link).

Examples

			a(3) = 7 * (1*7 + 6*(5/2 + 2)) = 238 because 3 discs played in different columns can be transposed in two ways.
		

Crossrefs

Cf. A090224 (upper bound), A013582.

A235610 Array read by antidiagonals: T(n,k) = number of possible positions in standard Connect Four play on a board of height n and width k (n>=1, k>=1).

Original entry on oeis.org

2, 3, 5, 4, 18, 13, 5, 58, 116, 35, 6, 179, 869, 741, 96, 7, 537, 6000, 12031, 4688, 267, 8, 1571, 38310, 161029, 158911, 29737, 750, 9, 4587, 235781, 1706255, 3945711, 2087325, 189648, 2118
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2014

Keywords

Examples

			The array as given on the Tromp web site:
height
------
8:      9       13343   8424616 1104642469
7:      8       4587    1417322 135385909       14171315454
6:      7       1571    235781  15835683        1044334437      69173028785     4531985219092
5:      6       537     38310   1706255 69763700        2818972642      112829665923
4:      5       179     6000    161029  3945711 94910577        2265792710      54233186631
3:      4       58      869     12031   158911  2087325 27441956        362940958
2:      3       18      116     741     4688    29737   189648  1216721
1:      2       5       13      35      96      267     750     2118
-------------------------------------------------------------------------------
-:      1       2       3       4       5       6       7  <- width
		

Crossrefs

A364823 Triangle read by rows: T(n,k) = number of possible positions for four connected discs in the game "Connect Four" played on a board with n columns and k rows, 4 <= k <= n.

Original entry on oeis.org

10, 17, 28, 24, 39, 54, 31, 50, 69, 88, 38, 61, 84, 107, 130, 45, 72, 99, 126, 153, 180, 52, 83, 114, 145, 176, 207, 238, 59, 94, 129, 164, 199, 234, 269, 304, 66, 105, 144, 183, 222, 261, 300, 339, 378, 73, 116, 159, 202, 245, 288, 331, 374, 417, 460
Offset: 4

Views

Author

Felix Huber, Aug 09 2023

Keywords

Comments

In the game, all these positions can be reached. The most difficult thing is to connect four discs in the top row in the case of n=k. Here are examples for 4 X 4, 5 X 5 and 6 X 6:
. b3 b12 b8 b11 .
b3 b5 b8 b10 . . a3 a12 b7 a11 .
b2 b4 b8 b7 b2 a5 a8 a10 . . b2 b10 a7 a10 .
a2 a4 a8 b6 a2 b4 b7 b9 . . a2 a8 b6 b9 .
b1 b3 a7 a6 b1 a4 a7 a9 . . b1 a6 b5 a9 .
a1 a3 b5 a5 a1 a3 b6 a6 . . a1 b4 a4 a5 .
For n >= 7 any position in the top row can be reached by the following procedure. By repeating the following scheme, a tower of any height up to the second highest row can be built by placing discs alternately:
b4 b3 a4 a3
a1 a2 b1 b2
You can also build a separate tower where you are completely free with at least three discs. While one player places his four discs in the top row, the other moves to these reserve squares. Therefore, any position of four connected discs in the top row can be realized. Example 7 X 7:
. a a a a . .
. b b a a . .
. a a b b . .
. b b a a . .
. a a b b . b
. b b a a . b
. a a b b . b
For vertical positions there are many reserve squares in the other columns, for diagonal and horizontal positions other than in the top row you have additional reserve squares above three of the four discs to connect. For n > k you have further columns with more reserve squares.

Examples

			The triangle T(n,k) begins:
  n/k   4     5     6     7     8     9    10 ...
   4:  10
   5:  17    28
   6:  24    39    54
   7:  31    50    69    88
   8:  38    61    84   107   130
   9:  45    72    99   126   153   180
  10:  52    83   114   145   176   207   238
   .
   .
   .
		

Crossrefs

Programs

  • Maple
    A364823 := proc(n) local k; for k from 4 to n do return 4*k*n - 9*k - 9*n + 18; end do; end proc; seq(A364823(n), n = 4 .. 100);

Formula

T(n,k) = 4*k*n - 9*k - 9*n + 18, 4 <= k <= n, comprising k*(n-3) = k*n - 3*k horizontal positions, n*(k-3) = k*n - 3*n vertical positions, and 2*(n-3)*(k-3) = 2*k*n - 6*k - 6*n + 18 diagonal positions.
T(n,n) = 4*n^2 - 18*n + 18 = A059193(n-2).

A342329 Number of different games of Connect Four on an (n+1) X n board.

Original entry on oeis.org

2, 90, 356232, 152505051772, 6961765466482521226
Offset: 1

Views

Author

Robin Jehn, Mar 08 2021

Keywords

Comments

There are many more game variations than positions in the game Connect Four since almost all positions can be reached in many different ways. For the regular 7 X 6 board there are 4531985219092 legal positions (see A212693). If we estimate the number of possible games with the formula (0.75*(n+1))^(n*(n+1)-1), i.e., on average the players have 75% free columns to choose from, there are about 3.0*10^29 possible games.

Examples

			a(1) = 2: on a 2 X 1 board the first player can insert their first disc in the right or in the left column, the second player has no choice anymore, hence there are two different games. Obviously for the 2 X 1 and 3 X 2 boards, all games will end in a draw.
		

Crossrefs

Programs

  • Python
    def next_turn(player): # there are players 0 and 1
        global total, position
        ngames = 0
        for i in range(n+1):
            fill = int(column[i]) # height of column i
            if fill < n: # throw a disc into column i
                position = position + 2 ** (i + (n + 1) * fill + ntimesnplus1 * player) # unique identifier for this position
                if position in games: # half of memory and cpu-time can be saved if you exploit symmetry of positions here
                    ngames = ngames + games[position]
                else:
                    column[i] = column[i] + 1
                    total = total + 1
                    if position in setfinalpos: # we have reached a known final position
                        ngames = ngames + 1
                    else: # check if the new position is a win or if the board is full
                        if check4win(position, player, fill, i) or total == ntimesnplus1:
                            setfinalpos.add(position)
                            ngames = ngames + 1
                        else:
                            numbergames = next_turn(1 - player)
                            ngames = ngames + numbergames
                    column[i] = column[i] - 1
                    total = total - 1
                position = position - 2 ** (i + (n + 1) * fill + ntimesnplus1 * player)
        games[position] = ngames
        return ngames

Extensions

a(5) from Kester Habermann, Mar 09 2021
Showing 1-5 of 5 results.