It's not a function (at least in this case)
No, it shouldn't be allowed, at least not as a "function".
Your submission is a hashmap, which isn't a function. Last time I checked I couldn't perform primality checking by accessing a hashmap (without hardcoding every number which is disallowed by this loophole).
@Mego stated that python's '
collections.defaultdict', can perform primality checking, and I'm guessing can add two numbers, and so it fulfills the definition of a function. But the again, python has functions, a hashmap simply is not a function.
Languages which have functions, those functions are the only functions. Anything else is not a function and is viable to abuse.
E.g. If "functions that get called in a different way", were allowed. Well, guess what? I have a solution that's called through eval! Huh,... I also have a function that's called through
So here's my stance:
If it's not a function, it's not a function
Pretty straightforward, eh?