I mean, those are much closer to functional than imperative tbh. At best it's simply too abstracted to discuss either way. Recipes would be a better example.
If you want to use that example it'd be more like this snippet that no one on earth would tell their children:
> Starting from n = 0, take the nth vegetable from your plate, insert your fork into that vegetable, raise your fork to your mouth, bite that vegetable, remove your fork from your mouth, masticate, add one to n, and repeat.