Question: Difficult function

I need help writing a function which takes a number of integers (which are greater than or equal to 2) and returns a list where the nth entry in the list is given by the number of arguments which can be expressed in the form of x^n where x is an integer. The function must also disregard all of the terms after the final integer greater than 0 is produced ie does not show 0, 0, 0, 0, at the end of the list.

Eg if f was the function f(27) = [1,0,1]

f(2,3,4,9,81,1024) = [6,4,0,1,1,0,0,0,0,1]

Please Wait...