Square - Square - Square - Pyramid
"All the balls have to be piled up in a square pyramid" , was the order issued to the regiment.Then came a further order , "All pyramids are to contain a square number of balls " (that the is number of balls which were used to make the square pyramid shall be a perfect square) whereupon the trouble arose."It cant be done said the major" , look at this pyramid for example ; there are 16 balls at the base , then 9, then 4 and then 1 at the top making 30 balls in all ," but there must be 5 fewer or 6 more balls to make a square number "."it must be done", Insisted the general. " All you have to do is to put the right number of of balls in your pyramid ". I have got it said the lieutenant, the mathematical genius of the regiment."Lay the balls out singly ." OH GOSH ! exclaimed the general ", You cant pile one ball into the pyramid !". if i say It is possible to obey both the orders then - you have to help the general to make such a kind of pyramid. if such a kind of pyramid can be made enter your answer as the total number of balls needed to make the pyramid.
NOTE : This problem is not original