OFFSET
0,2
COMMENTS
a(n) is 1/6 of the number of ways to select three points (x,y), (u,v), (p,q) with gcd(x-u,y-v) = gcd(u-p,v-q) = gcd(p-x,q-y) = 1 and 0 <= x, y, u, v, p, q <= n in an n X n grid.
LINKS
Felix Huber, Illustration of a(2)
EXAMPLE
See the linked illustration: a(2) = 36 because there are 36 ways to select three distinct points in a square grid with side length n that satisfy the condition.
MAPLE
A372218:=proc(n)
local x, y, u, v, p, q, a;
a:=0;
for x from 0 to n do
for y from 0 to n do
for u from 0 to n do
for v from 0 to n do
if gcd(x-u, y-v)=1 then
for p from 0 to n do
for q from 0 to n do
if gcd(x-p, y-q)=1 and gcd(p-u, q-v)=1 then a:=a+1 fi;
od;
od;
fi;
od;
od;
od;
od;
a:=a/6;
return a;
end proc;
seq(A372218(n), n=0..33);
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Huber, Apr 28 2024
STATUS
approved