Question: Serious Help needed !!!..

Hi everyone - I have two problems Im really hoping someone can help me understand how to overcome (I have spent hours and hours going round and round in circles!) Firstly the topic is square pyramid numbers i.e (1), (1+4), (1+4+9), (1+4+9+16), .. etc Im trying to come up with a program that will see a procedure, nPyrLayers(), which says which "layer" of a pyramid a number is.. i.e 5 is the 2nd layer, 14 is the 3rd and then draw a pyramid. I can build the pyramids with blocks (cubes) myself, I can find the nPyrLayers number, but I cant come up with a program that will draw ANY pyramid for any layer USING nPyrLayers... Is there a program I could write that could see "nPyrLayers" and then draw the pyramid with blocks itself? My other problem is triangular numbers: 1,3,6,10,15 Im trying to come up with a program that can see whether any triangular numbers can add together to produce another triangular number and if so, to return the two pairs (a,b) in a list with an upper and lower limit. so for example 6+15=21 which is a triangular number so would include (6,15) Any help here would be a massive help!!!
Please Wait...