<s>[INST] Q27 from AMC 2012(Senior): Five consecutive integers that sum to a perfect square, and the three middle terms sum to a perfect cube. 
Five consecutive integers $p,q,r,s,t$,each less than $10000$, produce a sum which is a perfect square, while the sum of $q,r,s$ is a perfect cube.What is the value of $ \sqrt{p+q+r+s+t}$ ?

What I have tried so far:
Let $p=r-2$
$p+q+r+s+t =5r $
$5r=x^2 $
$q+r+s =3r =y^3 $
$x^2 -y^3 =2r $
So,the only perfect squares which are divisible by $5$ are the multiples of $5$: $25,100,225,400...$
I also observed that $100-25=75,225-100=125$,where $125-75=50$.Trying that for $225-100=125,400-225=175$ where $175-125=50$
Then,for the perfect cube which are divisible by 3 and must be less than the perfect squares.
$30^3,60^3,90^3,120^3....$
And here is were I got stuck at...
Is the concept I'm using correct?
 [/INST] As $p+q+r+s+t = 5r$ and $q+r+s = 3r$ we have 
$$
5r = m^2, \quad 3r = n^3 \tag1
$$
for some integers $m$ and $n$. Thus $5\mid r$ and $3^2\mid r$, so $r = 5\cdot3^2\cdot r_1$ for som integer $r_1$. Substitute it to $(1)$:
$$
5^2\cdot 3^2\cdot r_1 = m^2, \quad 3^3\cdot 5\cdot r_1 = n^3. \tag2
$$
Thus $r_1$ is a perfect square ($r_1 = m_1^2$, where $m_1 = m/15)$ and $5^2\mid r_1$. One may see that $r_1 = 5^2\cdot r_2^2$, where $r_2$ is integer, satisfying bouth these conditions. Substitute it to $(2)$:
$$
5^2\cdot 3^2\cdot 5^2 \cdot r_2^2 = m^2, \quad 3^3 \cdot 5^3 \cdot r_2^2 = n^3.
$$
Now we see that $r_2^2$ is a perfect cube. But as $r < 10000$ and $r = 5\cdot 3^2\cdot 5^2\cdot r^2_2$ we get that $r_2^2 \le 8$. There is only one number less than or equal to $8$ which is bouth perfect square and perfect cube - it is $1$. So $r_2 = 1$ and $r = 5\cdot 3^2\cdot 5^2 = 1125$ and 
$$
\sqrt{p+q+r+s+t} = \sqrt{5r} = 3\cdot 5^2 = 75.
$$
</s>