I'm trying to write a function such that P(x) for any integer x there is a list of three elements, namely the square, cube, and fourth power of n but I'm stuck on how i can combine then to make one function for example i have the square, cube and the power 4 function here are my functions below
(defun p(x) (* x x))
(defun p(x) (* x x x))
(defun p(x) (expt x x) //thought i am not sure about this one
is there a way i can make my result(i.e function p(x) ) list look like (4 27 256) if I have a list of ( 2 3 4) after executing the program? Was thinking of mapcar function though I'm not sure on how I can go about it. Any suggestions?
LIST?