%I #19 Oct 08 2017 10:41:23
%S 0,1,22,158,674,2159,5664,13004,26904,51401,92094,156710,255090,
%T 400359,608656,900100,1299336,1836461,2546550,3472162,4661898,6173123,
%U 8071952,10434600,13346080,16905033,21221558,26419338,32636098,40027283,48761448
%N Number of parallelograms on an n X n grid.
%H Nathaniel Johnston, <a href="/A189416/a189416.c.txt">C program for computing terms</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Parallelogram.html">Parallelogram</a>
%F a(n) = Sum_{a=1..n-1} Sum_{b=1..n-1} (n-a)*(n-b)*(2*a*b - gcd(a,b)). - _Andrew Howroyd_, Sep 19 2017
%t a[n_] := Sum[(n-a)*(n-b)*(2*a*b - GCD[a, b]), {a, 1, n-1}, {b, 1, n-1}];
%t Array[a, 31] (* _Jean-François Alcover_, Oct 08 2017, translated from PARI *)
%o (PARI) a(n) = sum(a=1, n-1, sum(b=1, n-1, (n-a)*(n-b)*(2*a*b - gcd(a,b)) )); \\ _Andrew Howroyd_, Sep 19 2017
%Y Cf. A186434, A189413, A189414.
%K nonn
%O 1,3
%A _Martin Renner_, Apr 21 2011
%E a(6)-a(31) from _Nathaniel Johnston_, Apr 24 2011