What can be object of contemplation during meditation? Can I take a puzzle or mathematical problem for contemplation? What is the right way of contemplation?
All this involve conceptualisation which can lead to delusional thoughts as with any mind constructed concept it is easy to lose sight of its true nature. This is called Vipallasa as discussed in Vipallasa Sutta.
Sometimes you cannot avoid doing intellectual work like a puzzle or mathematical work. This is not ideal, but any kind of mental activity or when you cognize you experience some sensation. (Titth’ayatana Sutta, Dhātu Vibhaṅga Sutta, etc.)
So if you are sensitive enough then perhaps you can try to look at the arising and passing of these sensations with equanimity.
Some analysis from the Suttas.
Cognizing a mental object with the mind, one examines the mental object as the basis for pleasure, or for pain, or for neither-pain-nor-pleasure
Source: Titth’ayatana Sutta. Hence the puzzle and math problem inevitably create some sensation which falls into the the 3 categories of either pleasant, painful or neither pleasant or painful. Similar passage appears in Dhātu Vibhaṅga Sutta also.
If he wishes thus, ‘May I dwell rejecting both the unrepulsive and the repulsive, and dwell in equanimity, mindful and fully aware,’ he dwells therein equanimously, mindful and fully aware
Source: Indriya Bhāvanā Sutta. Clearly the math problem or puzzle is unrepulsive but you have to be equanimous when doing this.
he dwells contemplating states that arise in the ... he dwells contemplating states that fall away in the ... he dwells contemplating states that arise and fall away in the ... he maintains this mindfulness: ‘There is ...’ just sufficient for knowing and awareness And he dwells independent, not clinging to anything in this world ...
Source: Mahā Satipatthāna Sutta. Here
... And he dwells independent, not clinging to anything in this world ... is equanimously, in your case not getting excited about the problem.
... just sufficient for knowing and awareness ... means there is no conceptualisation and though proliferation, which you your case is present but this has some sensation as previously discussed. If you are sensitive enough you can look at these sensations.
Tibetan Budddhsm uses contemplation a lot. It is often called analytical meditation. The purpose is to penetrate various realities through deep and valid reasoning. True, the resulting insights are conceptual, but concepts can be valid when built upon valid reasoning. In our everyday life, we use concepts, and rely upon them for important decisions.
Eventually all concepts are burnt away by the fire of direct experience, when one beomes an Arya.A fire burns away the very wood that began it. But no wood, no fire.
As humans we are unique in having an advanced intellect. Not to use it, but to rely only upon experience and sensation is not to fully use the faculties we have.
There are more ways of "knowing" than just sensory experience. Inferential understanding based upon valid reasoning is more trustworthy than unverified experience.
For sure the most secure resource might be the Satipatthana Sutta: Frames of Reference or the Maha Satipatthana, as already linked. Actually you can take any phenomena (Dhamma) for your analysis, but its recommended to start with start with the body. What you might proof with your investigations is always, it they are lasting or if they are subject of decay. If knowing such in detail, and for sure, your will naturally lose interest in such an object and you may start to investigate the next in its smallest details for the same purpose. Upasaka Suminda Sirinath S. Dharmasena gave some good and further hints.