[Tex/LaTex] Tex symbols and package for falling factorial power. and other symbols

math-modepackagessymbols

There are a lot of new type of symbols used in book: Concrete mathematics by Graham Knuth and Patashnik, I am trying to find many of these useful notations as latex symbols but failed. e.g Falling Factorial power which looks something like : enter image description here

I tried a combination of ^ and \uline but doesn't seem as good.

Also how to show some text on top like following :

enter image description here

Best Answer

I see no real difficulty:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\fallingfactorial}[1]{%
  ^{\underline{#1}}%
}

\begin{document}

\[
x\fallingfactorial{n}={\overbrace{x(x-1)\dots(x-n+1)}^{\text{$n$ factors}}}
\]

\end{document}

enter image description here

After adding

\usepackage[euler-digits]{eulervm}

you get

enter image description here

By the way, this is exactly how it's realized in gkpmac.tex (the macro file used for typesetting “Concrete Mathematics”).

\input gkpmac

$$
x\_{n}\qquad x\_^{n}
$$

\bye

enter image description here

The macros:

\def\_#1{\def\next{#1}%
 \ifx\next\risingsign\expandafter\rising\else^{\underline{#1}}\fi}
\def\risingsign{^}
\def\rising#1{^{\overline{#1}}}

A possible improvement:

\documentclass{article}
\usepackage{amsmath}
\usepackage[euler-digits]{eulervm}

\newcommand{\fallingfactorial}[1]{%
  ^{\mspace{2mu}\underline{\mspace{-2mu}#1\mspace{-2mu}}\mspace{2mu}}%
}
\newcommand{\raisingfactorial}[1]{%
  ^{\mspace{2mu}\overline{\mspace{-2mu}#1\mspace{-2mu}}\mspace{2mu}}%
}

\begin{document}

\[
x\fallingfactorial{n}={\overbrace{x(x-1)\dots(x-n+1)}^{\text{$n$ factors}}}
\]

\[
x\raisingfactorial{n}={\overbrace{x(x+1)\dots(x+n-1)}^{\text{$n$ factors}}}
\]

\end{document}

enter image description here