OFFSET
1,2
LINKS
Ray Chandler, Table of n, a(n) for n = 1..1000
N. J. A. Sloane, Families of Essentially Identical Sequences, Mar 24 2021 (Includes this sequence)
FORMULA
a(n+1) = 4*A115004(n).
a(n) = 4*(n-1)^2 + 4*Sum_{i=2..n-1} (n-i)*(2n-i)*phi(i). - Chai Wah Wu, Aug 15 2021
EXAMPLE
a(2)=4 because 4 (isosceles right) triangles with area 1/2 can be placed on a 2 X 2 grid.
MATHEMATICA
z[n_] := Sum[(n - i + 1)(n - j + 1) Boole[GCD[i, j] == 1], {i, n}, {j, n}];
a[n_] := 4 z[n - 1];
Array[a, 40] (* Jean-François Alcover, Mar 24 2020 *)
PROG
(Python)
from sympy import totient
def A088658(n): return 4*(n-1)**2 + 4*sum(totient(i)*(n-i)*(2*n-i) for i in range(2, n)) # Chai Wah Wu, Aug 15 2021
CROSSREFS
Cf. A045996.
The following eight sequences are all essentially the same. The simplest is A115004(n), which we denote by z(n). Then A088658(n) = 4*z(n-1); A114043(n) = 2*z(n-1)+2*n^2-2*n+1; A114146(n) = 2*A114043(n); A115005(n) = z(n-1)+n*(n-1); A141255(n) = 2*z(n-1)+2*n*(n-1); A290131(n) = z(n-1)+(n-1)^2; A306302(n) = z(n)+n^2+2*n. - N. J. A. Sloane, Feb 04 2020
KEYWORD
nonn
AUTHOR
Yuval Dekel (dekelyuval(AT)hotmail.com), Nov 21 2003
EXTENSIONS
a(7)-a(28) from Ray Chandler, May 03 2011
Corrected and extended by Ray Chandler, May 18 2011
STATUS
approved