# Replace individual page numbers with mathematical expressions

I'd like to replace a few individual page numbers in a document with mathematical expressions, like $a^0$ for page 1, $2(2)^1$ for 4, etc. I don't have a ToC or index, so I'm not concerned about the actual page numbers changing; just what's printed at the bottom of the page.

I'm not sure it's helpful, but here's a MWE. Instead of a 1 at the bottom of the page, I want $a^0$.

\documentclass{article}

\usepackage{amsmath}

\begin{document}
Body of page, which is about exponential functions
\end{document}

-

Macro \thepage can be redefined to give the desired representation of the page number:

\documentclass{article}
\renewcommand*{\thepage}{%
\ifcase\value{page}%
0%
\or
$a^0$%
\or
$2^1$%
\or
3%
\or
$2^2$%
\else
\ifnum\value{page}=9 %
$3^3$
\else
\arabic{page}%
\fi
\fi
}
\begin{document}
\section{My document}
\label{sec:doc}
Body of page, which is about exponential functions.\\
Reference to section \ref{sec:doc} at page \pageref{sec:doc}.
\end{document}


-
for a short document, marvelous! but what about a 400-page book? might be able to use some other counter for the \ifcase statement, trigger its resetting somewhere on the affected page, and have a test (in the folio code?) when the page is set to make sure it's done only once. (of course, interspersing such nonstandard page numbers in a 400-page book would make life very difficult for the reader ... but i suppose a list somewhere equating the special numbers to the nominal page numbers might soften the pain.) – barbara beeton Oct 18 '12 at 12:44