Block Pyramids in Minecraft - closed formula for total number of blocks The total number of blocks within pyramids on Minecraft doesn't quite correspond with Square pyramidal numbers (on Wikipedia). Because of the blocky nature of the environment, the "even rows" of the pyramid are missed out. So, a simple 3-block-high pyramid has $1 + 9 + 25 = 35$ blocks. 

Hence the sum for a pyramid of height $n$ is given by $$\sum_{k=1}^n(2k - 1)^2$$

What's the corresponding shortcut formula for this series, involving $n^3$ ?
So we look for 
$$ P_n := \sum_{k=1}^n (2k-1)^2 $$
for an $n$-layer pyramid. We have $(2k-1)^2 = 4k^2 - 4k + 1$, hence
\begin{align*} 
  P_n &amp;= 4\sum_{k=1}^n k^2 - 4\sum_{k=1}^n k + n \\
      &amp;= 4\cdot \frac 16\cdot n(n+1)(2n+1) - 4 \cdot \frac 12 n \cdot (n+1) + n\\
      &amp;= \frac 23 \cdot (2n^3 + 3n^2 + n) - 2n² -2n + n\\
      &amp;= \frac 43 n^3 + \frac 23 n - n\\
      &amp;= \frac 13 n (4n^2-1)
\end{align*}
Okay, well we know that:

$$\sum_{i=1}^ni^2=\frac{1}{6}n(n+1)(2n+1)$$

What you want is to skip out the $4$ and the $16$ and so forth layers right?

Well you actually mean to say "you want the odd layers" which is actually:

$\sum_{i=1}^n(2i-1)^2=1^2+3^2+5^2+\cdots$

Notice that:

$$\sum^n_{i=1}(2i-1)^2=\sum^n_{i=1}[4i^2-4i+1]=\sum^n_{i=1}4i^2-\sum^n_{i=1}4i+\sum^n_{i=1}1$$

This is of course $=4\sum^n_{i=1}i^2-4\sum^n_{i=1}i+n$

Which we know to be $=\frac{4}{6}n(n+1)(2n+1)+n-4\sum^n_{i=1}i$


  Note that $$\sum^n_{i=1}i=\frac{1}{2}n(n+1)$$ 


Thus:

$$\sum^n_{i=1}(2i-1)^2=\frac{2}{3}n(n+1)(2n+1)+n-2n(n+1)$$

I leave you to do the factoring.