Explicit page.footercontent needs to explicitly show page number. The set rule does not display page number in any way. Furthermore, the provided example does not compile. Page Function – Typst Documentation
Instructions don’t tell anything about a placeholder code for the page number that I can put at X. (Everything would be much easier if we had a placeholder to introduce it in a string.)
You provided a snippet from the page footer, where set rules written in the code mode block, therefore adding # is like forcing to switch to code mode that is already active. Moreover, set rules must go above a styled content. The provided link demonstraits this.