I assume I'm not understanding something about myheadings and markboth. Here is my MWE (I'm running this on MikTeX 2.9 on a Win10 box):
\documentclass{article}
\begin{document}
\pagestyle{myheadings}
\markboth{}{Why is this not the right number? \arabic{page}}
First page.
\newpage
Another page.
\newpage
And another.
\end{document}
In all of the three pages, \arabic{page}
in the header prints 1, instead of the expected 1,2,3.
Best Answer
You're using the wrong tool for setting page numbers. Anyway, using
\protect\thepage
solves the issue, as it avoids\thepage
being expanded at the moment\rightmark
is assigned a value and deferring its evaluation to the header's print time.