[A] kind of black magic puzzle. The stars etched into the base of statues #1 and #4 are the only two to have a number of sides that have an integer square root (2 and 3, respectively). The 16-pointed star (square root of 4) completes this pattern.
I despise this sort of annoying, "what am I thinking?" puzzle, and genuinely have to wonder about the mentality of somebody who thinks that making players perform an A-level maths problem lest their characters die is a good idea.
Here's the way to make a shitty puzzle in D&D: come up with a problem or obstacle with a specific solution which you, the DM, have spent hours dreaming up in the darkness of your parents' basement. Guaranteed to turn into a pleasure-draining excursion into pixel-bitching.
Here's the way to make a good puzzle in D&D: come up with a problem or obstacle but don't think of a solution at all. Let the players work out a way around it and reward them for being creative and intelligent.
An example of a bad puzzle is one in which you have to not only work out integer square roots and use them to complete a pattern, but you first have to establish that integer square roots are the issue. An example of a good puzzle is a room in which a pile of treasure is separated from the players by a channel full of deadly crocodiles. The former requires the players to sit around for ages thinking, or else try idea after idea being repeatedly told "no, it doesn't work". The second requires the players to think of a creative solution to a problem.
D&D is not rocket science in either sense of the word.