First spiral, then diagonal
R, 43 34 bytes



function(n)(8*n^3-3*n^2+4*n+3)%/%6


Try it online!

The OEIS page lists the following formula for a(n):

(16*n^3 - 6*n^2 + 8*n + 3 - 3*(-1)^n)/12


However, I skipped right over that to get to the PROG section where the following PARI code is found:

floor((16*n^3 - 6*n^2 + 8*n + 3 - 3*(-1^n))/12))


Naturally, +3-3*(-1^n) is the same as +6 so we can simplify the linked formula, first by reducing it to

(16*n^3-6*n^2+8*n+6)/12 -&gt; (8*n^3-3*n^2+4*n+3)/6


and using %/%, integer division, rather than / to eliminate the need for floor.