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.

A352426 Maximal number of nonattacking white-square queens on an n X n chessboard.

Original entry on oeis.org

0, 1, 1, 2, 4, 4, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 53
Offset: 1

Views

Author

Martin Ehrenstein, Mar 16 2022

Keywords

Comments

Equivalently the maximal number of nonattacking black-square queens on an inverted n X n chessboard, that is a board with the a1 square white, the a2 and b1 squares black, etc.

Crossrefs

Programs

  • Python
    def fill(rows, queens, leftattack, notdownattack, rightattack, color):
        global c
        available = ~leftattack & notdownattack & ~rightattack & color
        if rows==1:
            if available==0:
                c[queens] = c.get(queens, 0) + 1
            else:
                c[queens+1] = c.get(queens+1, 0) + bin(available).count('1')
            return
        while available:
            attack = available & -available
            fill(rows-1, queens+1, (leftattack|attack)<<1, notdownattack&~attack, (rightattack|attack)>>1, ~color)
            available &= available - 1
        fill(rows-1, queens, leftattack<<1, notdownattack, rightattack>>1, ~color)
    print(' n a(n)    count')
    for n in range(1, 32):
        c=dict()
        fill(n, 0, 0, (1<
    				

Formula

a(2n) = A352241(2n).

Extensions

a(17)-a(24) from Vaclav Kotesovec, Mar 17 2022
a(25)-a(26) from Vaclav Kotesovec, Mar 20 2022
a(27) onwards from Andy Huchala, Mar 27 2024