# Number of Cubies problem

#### Igora

##### Member
I've been working out an equation for the number of cubies in a regular cube (not helicopter, skewb etc.) so far I've got c=6x^2-8x+4 where x is the number of cubies on one side of the cube, for instance in a 7x7x7 x=7. The only problem with this equation is that it doesn't work for a 1x1x1 cube. Any thoughts on one that would?

#### brunson

##### Member
I don't think it works for 2, either.
x^3 - (x-2)^3 works a bit better. That's how many blocks if the cube was solid, minus the number of cubies that would fit inside it if it were hollow.

(But it still doesn't work for 1)

Last edited:

#### cmhardw

I've been working out an equation for the number of cubies in a regular cube (not helicopter, skewb etc.) so far I've got c=6x^2-8x+4 where x is the number of cubies on one side of the cube, for instance in a 7x7x7 x=7. The only problem with this equation is that it doesn't work for a 1x1x1 cube. Any thoughts on one that would?
6*9 - 8*3 + 4 = 34

So it does not work for the 3x3x3 either.

Hint: You are on the right track, keep going with the corrections. For example, you know the 6*x^2 is an overcount, and counts more pieces than are actually on the cube. Take a look at your method for fixing this overcount (i.e. the other terms in your formula).

Chris

#### cmhardw

1x1 doesn't work though...
do you need a formula to tell you how many cubies are in a 1x1?? >_>
The 1x1x1 case fails on most formulas involving the n x n x n cube. Usually we just say that for the formula n > 1 must be true. It might be possible to come up with one single explicit formula that includes the 1 x 1 x 1 case correctly, but I don't know of one. That's not to say that it hasn't been done though.

Chris

#### hawkmp4

##### Member

c=x^3-(x-2)^3
Yep Though usually people write the simplified form for this.

Chris
1x1 doesn't work though...
do you need a formula to tell you how many cubies are in a 1x1?? >_>
No, but having an equation that works more generally is...well...nicer.

#### Igora

##### Member
oops, I accidentaly posted the wrong one :fp, the one I meant to post is c=6x^2-12x+8 rather than 6x^2-8x+4

#### hawkmp4

##### Member
Are we counting centres as cubies? I wouldn't think so...in which case x^3-(x-2)^3 would over count.
Hm...this is more complicated than I thought...I originally thought to just subtract 6 for centres...but that will only work for odd x.

Well, regardless, for odd x, x not equal to one, x^3-(x-2)^3-6 should work. I will have to think about the even case...

#### Igora

##### Member
Are we counting centres as cubies? I wouldn't think so...in which case x^3-(x-2)^3 would over count.
Hm...this is more complicated than I thought...I originally thought to just subtract 6 for centres...but that will only work for odd x.

Well, regardless, for odd x, x not equal to one, x^3-(x-2)^3-6 should work. I will have to think about the even case...
Well, I count them as cubies, but if you don't, the even's case would be simply x^3-(x-2)^3 without the added -6.

#### hawkmp4

##### Member
Are we counting centres as cubies? I wouldn't think so...in which case x^3-(x-2)^3 would over count.
Hm...this is more complicated than I thought...I originally thought to just subtract 6 for centres...but that will only work for odd x.

Well, regardless, for odd x, x not equal to one, x^3-(x-2)^3-6 should work. I will have to think about the even case...
Well, I count them as cubies, but if you don't, the even's case would be simply x^3-(x-2)^3 without the added -6.
Yes, that's clear. I was hoping to come up with an explicit equation that works for all x. Well. For all natural numbers.

#### Lucas Garron

##### Super-Duper Moderator
Staff member
It might be possible to come up with one single explicit formula that includes the 1 x 1 x 1 case correctly, but I don't know of one.
Getting such a formula is trivial, of course, by adjusting for n=1.

Now, why is there no polynomial that'll work for all positive integers?

#### cmhardw

It might be possible to come up with one single explicit formula that includes the 1 x 1 x 1 case correctly, but I don't know of one.
Getting such a formula is trivial, of course, by adjusting for n=1.

Now, why is there no polynomial that'll work for all positive integers?
I don't really know to be honest. I've been trying to think of how to use the floor, ceiling, or mod functions to accomplish one formula that mimics the "standard" one, and also allows for the n=1 case.

Other than your idea of making a piecewise function defining the n=1 case, I don't know why a single polynomial solution won't work.

We know that the polynomial
$$P(n)=6n^2-12n+8$$

works perfectly for $$n>1$$. P(n) fails for n=1, so we must assume there exists another polynomial Q(n) such that Q(n) = P(n) for all natural numbers n>1, but $$Q(1) \not= P(1)$$ must be true. In fact, P(1)=2 and Q(1) we want to be equal to 1.

My higher math is apparently not very sound, because it is not immediately apparent to me why Q(n) does not exist.

Chris

#### hawkmp4

##### Member
It might be possible to come up with one single explicit formula that includes the 1 x 1 x 1 case correctly, but I don't know of one.
Getting such a formula is trivial, of course, by adjusting for n=1.

Now, why is there no polynomial that'll work for all positive integers?
I can easily see why there is no quadratic that works. But I suppose that's rather trivial. I'm with Chris, I don't see why a polynomial couldn't exist.

#### Lucas Garron

##### Super-Duper Moderator
Staff member
I don't really know to be honest. I've been trying to think of how to use the floor, ceiling, or mod functions to accomplish one formula that mimics the "standard" one, and also allows for the n=1 case.
There's always the standard absolute value cheat:
x^3 - (x - 2)^3 + (x - Abs[x - 2] - 2)/2

I can easily see why there is no quadratic that works. But I suppose that's rather trivial. I'm with Chris, I don't see why a polynomial couldn't exist.
No finite polynomial will work for the same reason no quadratic will work:

Take R = P-Q. R must be 0 at every positive integer >1. The only finite polynomial with this property is 0. What Chris said, really.
(You can't "hack" a polynomial at specific parts while preserving infinitely many other values.)

#### hawkmp4

##### Member
I don't really know to be honest. I've been trying to think of how to use the floor, ceiling, or mod functions to accomplish one formula that mimics the "standard" one, and also allows for the n=1 case.
There's always the standard absolute value cheat:
x^3 - (x - 2)^3 + (x - Abs[x - 2] - 2)/2

I can easily see why there is no quadratic that works. But I suppose that's rather trivial. I'm with Chris, I don't see why a polynomial couldn't exist.
No finite polynomial will work for the same reason no quadratic will work:

Take R = P-Q. R must be 0 at every positive integer >1. The only finite polynomial with this property is 0. What Chris said, really.
(You can't "hack" a polynomial at specific parts while preserving infinitely many other values.)
That was what I was thinking, but I had absolutely no idea how to explain it mathematically. Thanks!

#### meichenl

##### Member
We could write a recursion relation.

For $$n=0$$ we need $$0$$ cubies, so

$$S_0 = 0$$.

Imagine taking an $$n-1 * n-1$$ cube and adding cubies to make it into an $$n * n$$ cube.

$$S_n = S_{n-1} + ...$$

You'd have to add a layer of cubies around the outside. Add an $$n * n$$ face to R with the extra cubies hanging above U and B. Then add an $$(n-1) * (n-1)$$ block to U. Finally add $$(n-1) * n$$ to B. That comes to $$3n^2 - 3n + 1$$ cubies added.

$$S_n = S_{n-1} + 3n^2 - 3n + 1 ...$$

But some old cubies got covered up completely. This happened to stuff in the URB corner of the smaller cube and its vicinity. What got covered up was basically an $$n-2 * n-2$$ cube.

$$S_n = S_{n-1} + 3n^2 - 3n + 1 - S_{n-2}...$$

Part of that $$S_{n-2}$$ cube had already been covered, though, so we have to add back in a cube of size $$S_{n-3}$$

$$S_n = S_{n-1} + 3n^2 - 3n + 1 - S_{n-2} + S_{n-3}...$$

et cetera

$$S_n = S_{n-1} + 3n^2 - 3n + 1 - S_{n-2} + S_{n-3} - S_{n-4} + S_{n-5}... S_1$$

If we plug in the same thing evaluated for $$S_{n-1}$$, that whole long alternating summation cancels out, and we have

$$S_n = 3n^2 - 3n + 1 + 3(n-1)^2 - 3(n-1) + 1$$

which is the same equation mentioned earlier.

It doesn't work for $$S_1$$, though, because $$S_0$$ is simply assigned the value $$0$$. We cannot make the substitution
$$S_0 = 0^2 + -3*0 + 1 + ...$$ because the recursion only applies to higher $$n$$.

Instead we just have $$S_1 = 3*1^2 - 3*1 + 1 + S_0 = 1$$.

#### mrCage

##### Member
Why use the number of cubies on a single face as the variable x, and not simply the cube dimension?

Per