For the main case ($3\times 3\times 3$), here is a solution using 13 blocks:
1 1 0 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 0 1 0 0
Update. : For the $4\times 4\times 4$ case, here is a solution using 25 only 24 blocks. This configuration includes the $3\times 3\times 3$ configuration above in one corner. (This may be a bit easier , which is optimal according to see if you look at the rightmost view that Joseph $\frac{3}{2}n^2-\frac 12$ lower bound provided of the 13 block solution.)by Douglas and Gjergji.
0 1 1 1 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 1
It appears that we may still hope for a 24 block solution, according to Douglas's $\frac{3}{2}n^2-\frac 12$ lower bound.
(Click on the edit history for my previous answersolutions, which provided a used first 27 blocks, then 26block solution, as well as the bound $C_3(n)\ \leq \ 2(n^2-n)+\lfloor\frac{n}{2}\rfloor+1$then 25, which is and now supplanted by other answers.24.)

