Here's how I understand your problem:Originally Posted byrpatel

The 1x1 case is a cube, with 6 cubes stuck on the 6 faces. Result: 1 "dark" cube, 6 cubes that you can see, total of 7 cubes.

The 3x3 case is the object from the 1x1 case, with 18 cubes stuck on the faces of the 7 cubes. Result: 7 "dark" cubes (that's the 7 original from the 1x1 object), 18 cubes that you can see, total of 25 cubes.

The 5x5 case is the object from the 3x3 case, with 38 cubes stuck on the faces of the 25 cubes. Result: 25 "dark" cubes (that's the 25 from the 3x3 object), 38 cubes that you can see, total of 63 cubes.

And so on.

Now to fit the number of "dark" cubes to a formula , where n = 1, 2, 3, 4, you get the equations

.

The solution is .

So the number of dark cubes for the n-th object is . Believe it or not, this is always an integer.

The number of total cubes for the n-th object is the same as the number of dark squares for the (n+1)th object, hence - you can expand this if you want.

Finally the number of visible cubes for the n-th object is the difference of these two expressions.

Hope this helps.btw, this is definitely not grade school stuff.