OFFSET
1,3
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..1000
M. A. Alekseyev, M. Basova, and N. Yu. Zolotykh. On the minimal teaching sets of two-dimensional threshold functions. SIAM Journal on Discrete Mathematics 29:1 (2015), 157-165. doi:10.1137/140978090. See p. 158.
MAPLE
VR := proc(m, n, q) local a, i, j; a:=0;
for i from -m+1 to m-1 do for j from -n+1 to n-1 do
if gcd(i, j)=q then a:=a+(m-abs(i))*(n-abs(j)); fi; od: od: a; end;
[seq(VR(n, n, 2), n=1..50)];
MATHEMATICA
A331772[n_]:=Sum[If[GCD[i, j]==2, If[i==j, 4(n-i)^2, 8(n-i)(n-j)], 0], {i, 2, n-1, 2}, {j, 2, i, 2}]+If[n>2, 4n(n-2), 0]; Array[A331772, 50] (* Paolo Xausa, Oct 18 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 08 2020
STATUS
approved