Calculators
Two Bishops Calculator
Count attacking and non-attacking placements of two bishops on a rectangular chessboard with exact browser-only arithmetic.
Count ways to place two indistinguishable bishops on distinct squares so neither attacks the other. Enter positive board dimensions of up to 100 digits. No other pieces or blocked squares are included. Results stay in your browser.
How to count non-attacking bishop placements
On an r-row by c-column board, N = rc squares give N(N − 1)/2 unordered pairs of distinct squares. Bishops attack along diagonals. At diagonal distance d, there are 2(r − d)(c − d) attacking pairs, accounting for both diagonal directions. Sum for d = 1 through k = min(r, c) − 1. The closed formula is A = 2[krc − (r + c)k(k + 1)/2 + k(k + 1)(2k + 1)/6]. Non-attacking pairs equal N(N − 1)/2 − A. An 8 × 8 board has 2016 total pairs, 280 attacking pairs and 1736 non-attacking pairs. A 2 × 3 board has 15 total pairs, 4 attacking pairs and 11 non-attacking pairs. A one-row or one-column board has no attacking bishop pairs, and a single square has no placement of two pieces. The bishops are indistinguishable; swapping them does not create a new placement. Assume an otherwise empty complete board without blocked squares or wrapping edges. Both same-color and opposite-color square placements are included. This counts placements of exactly two bishops, not legal chess positions or arrangements of more pieces. Enter positive integers with up to 100 decimal digits per dimension. Leading zeros and surrounding whitespace are accepted; signs, decimals, separators and exponents are rejected. Closed formulas and BigInt arithmetic preserve every digit without iterating over board squares. All processing stays in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
How many non-attacking bishop pairs fit on an 8 × 8 board?
There are 1736 unordered non-attacking pairs: 2016 total pairs minus 280 attacking pairs.
How are attacking bishop pairs counted?
Sum 2(r − d)(c − d) for diagonal distances d from 1 to min(r, c) − 1. A closed formula evaluates this sum without visiting each square.
Are the bishops distinguishable?
No. Swapping the bishops gives the same placement. For two labeled bishops, double each pair count.
Can I use a one-row board?
Yes. There are no attacking diagonal pairs on a one-row or one-column board. A single square gives zero placements.
Must the bishops stand on opposite colors?
No. Both same-color and opposite-color placements are included. Bishops on opposite colors cannot attack one another, but some same-color pairs are also non-attacking.