a few suggestions
1) have them practice what i call "function deconstruction and reconstruction" in which they are given a mathematical function (conversion between Fahrenheit and Celcius, quadratic formula, etc) and have them code a seperate function for each individual step of calculating the equation. Then in their main function (whichever language it may be) have them attempt to combine all of their functions so that the program actually performs the desired output. It is also useful to have them play around with the order of function calls etc. to explore the order of operations and how it effects the output
2) give them code (preferably one that calculates/evaluates something as per your learning goal) which has some redundancies in it and ask them to "optimize" it, i.e. take out the redundancies. This will require them to not only understand the code and how it relates to the math, but then to analyze where the math is being extraneous
3) give them the challenge to come up with as many ways as possible to calculate the fibonacci sequence, great way to get students thinking about sequences, recursive definitions, iteration, and multiple approaches to the same problem. once they do it you can have them seed their functions with different numbers to see how the sequences will differ
4) give them code that is calculates an equation/formula and have them "decode" the program and come up with what equation/formula it calculates, great way to promote "thinking backwards" and also practice translating between code and maths
5) have them diagram a program by showing functions/blocks as boxes that are linked with arrows representing function calls/input/output, at first this sounds not math related but i have found that it not only gives them a better understanding of the functional aspect of coding but it also lets them practice diagramming skills which are incredibly helpful when solving math problems, especially word problems
these are just a few that i have tried/thought about trying. if i come up with more i will definitely edit my answer, i hope these help!