# Calculate number of small cubes making up large cube given number in outermost layer

I have a large cube made up of many smaller cubes. Each face of the cube is identical, and all of the smaller cubes are identical. I need to calculate the number of small cubes that make up the large cube. Just to make it clear, the cube is solid (made up of little cubes all the way through).

The only value I have to work this out from is the number of small cubes that make up the outermost layer. This number is $100,614,152$.

What is the simplest way to calculate the total number of small cubes making up the large cube?

-
Is this homework? –  Jonathan Christensen Dec 6 '12 at 21:32
No, it's for a blog article I am writing –  eskimo Dec 6 '12 at 21:34
I presume this question is as a matter of Curiosity? :-) –  Steven Stadnicki Dec 6 '12 at 21:57
@StevenStadnicki well spotted sir –  eskimo Dec 7 '12 at 7:37

Let the big cube be of dimension $(x+2)$ (made up of $(x+2)^3$ smaller cubes). Then $(x+2)^3-x^3=100,614,152$. This reduces to a quadratic equation which you can solve.

-
Not quite: it would be $(x+1)^3 - (x-1)^3 = 100,614,152$. Edit: the answer has been corrected. –  Jonathan Christensen Dec 6 '12 at 21:38
+1 This is the most elegant among all the solutions. –  user17762 Dec 6 '12 at 21:42

Let $x$ be the number of small cubes along each edge of the large cube. Then each face of the large cube contains $x^2$ small cubes. $6x^2$ isn't the total number of cubes around the outside, though, because we're double-counting the cubes along each of the edges, so we need to subtract off $12x$. Then we aren't counting the cubes at the corners (we counted them three times--once in each face--and subtracted them three times), so we need to add back on 8. So we have $$6x^2 -12x + 8 = 100,614,152.$$ Now this is just a simple quadratic. Combine the terms on one side and use the quadratic formula (or Wolfram Alpha) to find that $x = 4096$.

-
+1 for first answer –  Amr Dec 6 '12 at 21:41

If one big cube is divided into $n$ times smaller cubes, then there are $n^3$ cubes. Taking avay the outer layer, we are left with $(n-2)^3$ cubes. The difference is $$n^3-(n-2)^3= n^3-(n^3-6n^2+12n-8)=6n^2-12n+8$$ and this shall equal $N=100614152$. Therefore, a good approximation for $n$ is given by $$n=\sqrt {\frac N 6}\approx 4095.0004$$ However, $n=4095$ leads to $6n^2-12n+8=100565018$, not quite your expected result. But with $n=4096$, the result is correct: $6n^2-12n+8=100614152$.

Note that trying to compute the solution of $$6n^2-12n+(8- 100614152)$$ would not have been easy due to rounding errors.

-
Rounding errors, pfft. You can do that computation using an exact representation, like cyclotomic numbers –  Ben Millwood Dec 6 '12 at 21:43
Secondinng Ben's comment, I'm not sure what rounding errors you're expecting; this isn't an equation with large amounts of cancellation since $b^2\not\approx 4ac$, so just dividing through by 6 to get $n^2-2n-16769024=0$ and then using the standard quadratic formula is fine. You have to take the square root of the eight-digit number 67076100 but that's essentially a trivial matter. –  Steven Stadnicki Dec 6 '12 at 23:41
You are right, I didn't even try it and had in min that the other solution might be $\approx0$, while of course it is $\approx -n$. –  Hagen von Eitzen Dec 7 '12 at 16:21
Let the size of the small cube be $1 \times 1 \times 1$ and size of the larger cube be $n \times n \times n$. The number of smaller cubes on the outer surface is given by $$\underbrace{2n^2}_{\text{Cover two opposite sides}} + \underbrace{2n(n-2)}_{\text{Cover next pair of opposite sides}} + \underbrace{2(n-2)^2}_{\text{Cover the remaining pair of opposite sides}}$$