I am new to ruby and working on a problem but I don't know how to figure it out.I want to write a function that return true if each consecutive element is a power of the previous element, otherwise return false
for example: if I have a list [2;4;8;16] the function should return truefunction should return false , [3; 7; 9;]
let consec_ele element = match element with[] -> trueh::t -> if h > t then falseelse if t/h = 0 && t mod h = 0 then true;;
i just can't figure out how to make it work and that so recursively.