Function machines

If the numbers 5, 7 and 4 go into this function machine, what numbers will come out?

Problem



Image
Function Machines


This one is a bit more of a puzzle.

Image
Function Machines


Can you work out what happens in the three circles?