Let's divide a lattice
JavaScript (ES6), 113 111 bytes
Saved 2 bytes thanks to guest44851
0-indexed.
n=&gt;[...Array(n)].map((_,i,a)=&gt;a.map((_,j)=&gt;x+=(g=(a,b)=&gt;b?g(b,a%b):a&lt;2&amp;&amp;(n-i-1)*(n-j))(i+1,++j)),x=n*++n)|x+x+1

Based on the formula mentioned on OEIS:

Let V(m,n) = Sum_{i=1..m, j=1..n, gcd(i,j)=1} (m+1-i)(n+1-j)
a(n+1) = 2(n2 + n + V(n,n)) + 1

Demo


let f =

n=&gt;[...Array(n)].map((_,i,a)=&gt;a.map((_,j)=&gt;x+=(g=(a,b)=&gt;b?g(b,a%b):a&lt;2&amp;&amp;(n-i-1)*(n-j))(i+1,++j)),x=n*++n)|x+x+1

for(n = 0; n &lt; 50; n++) {
  console.log('f(' + n + ') = ' + f(n));
}