TITLE: Greatest number of non-attacking moves that queens can make on an $n \times n$ chess board.
QUESTION [23 upvotes]: I'm trying to extend my OEIS sequence A275815: Maximum total number of possible moves that any number of queens of the same color can make on an $n \times n$ chessboard.
I have computed the first five terms by brute force, and examples of each are given below.
For $n \geq 6$, Alec Jones has conjectured that $A275815(n) = 8(n-2)^2$, which is achieved by placing $4n - 4$ queens around the border of the board—but this has not been proven. Alec's heuristic is based on summing the number of queens that can move to each empty square (which is no more than 8) instead of summing the number of moves each individual queen can make. 
Any thoughts on how to begin to prove this conjecture?

Examples:
A $2\times 2$ chess board can "host" 4 queen moves: 

$a1 \to b1$ 
$a1 \to b2$
$a2 \to b1$ 
$a2 \to b2$


A $3 \times 3$ board can host 17 moves:
(The queen at a3 has three moves, the queen at a2 has four moves, and the queens at b1 and c3 each have five moves.)

A $4 \times 4$ board can host 40 moves:

And a $5 \times 5$ board can host 76 moves:

REPLY [2 votes]: While still being brute force, turning this problem into an integer linear programming problem can fill the gap up to "sufficiently large".
Here is python3 code using the PuLP library (the relevant package is called python3-pulp on debian) that confirms the conjecture for all $n<25$ in less than a minute. It can go higher if needed.
from pulp import *

near = [-1, 0, 1]

dirs = [ (x,y) for x in near for y in near if (x,y) != (0,0) ]

def ray(start, dir, valid):
    res = []
    x,y = start
    dx,dy = dir
    while x in valid and y in valid:
        res.append((x,y))
        x += dx
        y += dy
    return (start,dir,res[1:])

def mq(n):
    print("n =", n)
    prob = LpProblem("Maximize Queen moves", LpMaximize)
    R = range(n)
    positions = [(i,j) for i in R for j in R]
    queen = LpVariable.dicts("Q", positions, 0, 1, LpInteger)
    # queen[pos]=1 iff there is a queen at pos
    rays = [ ray(pos, dir, R) for pos in positions for dir in dirs ]
    rays = [ r for r in rays if r[2] != [] ]
    posdirs = [ (pos,dir) for pos,dir,_ in rays ]
    reach = LpVariable.dicts("R", posdirs, 0, 1, LpInteger)
    # reach[(pos,dir)]=1 iff pos is free and there is a queen in direction dir
    prob += lpSum(reach) # objective function
    for pd in posdirs:
        prob += queen[pd[0]] + reach[pd] <= 1
    for pos,dir,r in rays:
        prob += lpSum([queen[p] for p in r]) - reach[(pos,dir)] >= 0
    prob.solve()
    assert prob.status==LpStatusOptimal, "Couldn't solve"
    print(int(value(prob.objective)), "moves:")
    print()
    for i in R:
        for j in R:
            print(".Q"[int(value(queen[(i,j)]))], end='')
        print()
    print()
    print()

if __name__ == "__main__":
    for i in range(2,25):
        mq(i)

If you want to minimize the number of queens as secondary optimization goal, use something like n**2*lpSum(reach)-lpSum(queen) as objective function.