Let’s consider the highly analytical algorithm of deciding whether a number is prime or not.

How does the brain do that in the current view of HTM theory?

I learn the procedures, the checks and the transformations I have to make on numbers, then I can easily apply the algorithm to any number, including numbers I’ve never seen before.

The numbers don’t come into the brain sparse-encoded in a special way specifically for this problem, they come in encoded the way I’ve learned numbers in kindergarten.

What would it take to make a HTM capable of solving such a problem under these constraints?