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.

A062104 Square array read by antidiagonals: number of ways a black pawn (starting at any square on the second rank) can (theoretically) end at various squares on an infinite chessboard.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 3, 6, 0, 1, 3, 9, 15, 0, 1, 3, 10, 25, 40, 0, 1, 3, 10, 29, 69, 109, 0, 1, 3, 10, 30, 84, 193, 302, 0, 1, 3, 10, 30, 89, 242, 544, 846, 0, 1, 3, 10, 30, 90, 263, 698, 1544, 2390, 0, 1, 3, 10, 30, 90, 269, 774, 2016, 4406, 6796, 0, 1, 3, 10, 30, 90, 270
Offset: 0

Views

Author

Antti Karttunen, May 30 2001

Keywords

Comments

Table formatted as a square array shows the top-left corner of the infinite board.

Examples

			Array begins:
0       0       0       0       0       0       0       0       0       0       0       0 ...
1       1       1       1       1       1       1       1       1       1       1 ...
2       3       3       3       3       3       3       3       3       3 ...
6       9       10      10      10      10      10      10      10 ...
15      25      29      30      30      30      30      30 ...
40      69      84      89      90      90      90 ...
109     193     242     263     269     270 ...
302     544     698     774 ...
846     1544    2016 ...
2390    4406 ...
6796 ...
		

Crossrefs

A062106 gives the left column and A062107 the diagonal of the table. A062105 is a more regular variant. Cf. also A062103. Trinv given at A054425.

Programs

  • Maple
    [seq(CPTSeq(j),j=0..91)]; CPTSeq := n -> ChessPawnTriangle( (1+(n-((trinv(n)*(trinv(n)-1))/2))), ((((trinv(n)-1)*(((1/2)*trinv(n))+1))-n)+1) );
    ChessPawnTriangle := proc(r,c) option remember; if(r < 2) then RETURN(0); fi; if(c < 1) then RETURN(0); fi; if(2 = r) then RETURN(1); fi; if(4 = r) then RETURN(1+ChessPawnTriangle(r-1,c-1)+ChessPawnTriangle(r-1,c)+ChessPawnTriangle(r-1,c+1));
    else RETURN(ChessPawnTriangle(r-1,c-1)+ChessPawnTriangle(r-1,c)+ChessPawnTriangle(r-1,c+1)); fi; end;
  • Mathematica
    trinv[n_] := Floor[(1 + Sqrt[8 n + 1])/2];
    CPTSeq[n_] := ChessPawnTriangle[(1 + (n - ((trinv[n]*(trinv[n] - 1))/2))), ((((trinv[n] - 1)*(((1/2)*trinv[n]) + 1)) - n) + 1)];
    ChessPawnTriangle[r_, c_] := ChessPawnTriangle[r, c] = Which[r < 2, 0, c < 1, 0, 2 == r, 1, 4 == r, 1 + ChessPawnTriangle[r - 1, c - 1] + ChessPawnTriangle[r - 1, c] + ChessPawnTriangle[r - 1, c + 1], True, ChessPawnTriangle[r - 1, c - 1] + ChessPawnTriangle[r - 1, c] + ChessPawnTriangle[r - 1, c + 1]];
    Table[CPTSeq[j], {j, 0, 91}] (* Jean-François Alcover, Mar 06 2016, adapted from Maple *)

Extensions

Edited by N. J. A. Sloane, May 22 2014