Finding the number of items in a sequence

389 Views Asked by At

Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a volume of $n^3$, the cube above will have volume of $(n-1)^3$ and so on until the top which will have a volume of $1^3$.

You are given the total volume of the building. Being given m can you find the number n of cubes you will have to build?

$V = n^3 + (n-1)^3+(n-2)^3+...+1^3$

So far I thought I can use arithmetic sequence :

$V= (n-0)^3+(n-1)^3+(n-2)^3+...+(n-(n-2))^3+(n-(n-1))^3$

$V = x(\frac{n^3+1}{2})$ where $x =$ number of cubes

then I get stuck here.

2

There are 2 best solutions below

2
On BEST ANSWER

Following @GaurangTandon's answer, there's a nice trick to apply here. We have $$ \frac{n^2(n+1)^2}{4}=m\tag{1} $$ Now if you look carefully, you'll see that if $n > 0$ solves this, so does $1-n$ (which will be less than zero). If only that were $-n$, we'd have a solution that depends only on the square of something, and that'd simplify things.

Well, we can sort of fix that. Let $s = n + \frac{1}{2}$, so that $n = s-\frac{1}{2}$, and let's rewrite in terms of $s$. Once we find $s$, we can recover $n$, OK?

In terms of $s$, equation (1) becomes $$ \frac{(s-\frac{1}{2})^2(s+\frac{1}{2})^2}{4}=m\tag{2} $$ Simplifying a little, we get $$ (s-\frac{1}{2})^2(s+\frac{1}{2})^2= 4m\tag{3} $$ And the left-hand side simplifies too: $$ [(s-\frac{1}{2})(s+\frac{1}{2})]^2= 4m\\ (s-\frac{1}{2})(s+\frac{1}{2}= \sqrt{4m}\\ (s^2-\frac{1}{4})= \sqrt{4m}\\ $$ So now $$ s^2= \frac{1}{4} + \sqrt{4m}\\ s= \pm\sqrt{\frac{1}{4} + \sqrt{4m}}. $$ Since we clearly want the positive value for $n$, we get $$ n = s + \frac{1}{2} = \sqrt{\frac{1}{4} + \sqrt{4m}} + \frac{1}{2}. $$

That can be simplified a little bit to make it prettier, but I leave that to you.

4
On

The question is pretty straightforward application of the formula for sum of first $n$ cube-natural numbers. You mentioned that:

well my problem is I have 2 variables and I don't know how to get rid of it

Read your equation correctly, there is only one variable $n$. The total volume of the building - $m$ - is a constant. We don't know the value of $m$, but whatever it is, it will be fixed throughout the problem.

Rewriting your equation might help:

$$m=1^3+2^3+\cdots+n^3$$

which as also noted in the comments is a standard formula for sum of first $n$ cube-natural numbers.

Can you solve this now?


UPDATE: $$\frac{n^2(n+1)^2}{4}=m\tag{1}$$ implies $$n^4+2n^3+n^2-4m=0$$

As noted in the comments by @JohnHughes, you have a reasonable approximation $n\approx(4m)^{\frac 14}$ by taking the fourth root of $\text{Eq (1)}$. If your question demands an integral answer, you can check the two-three integers next to this approximate value of $n$.