\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}

\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
\usepackage{amssymb,amsmath,amsfonts} % nice math rendering
\usepackage{braket} % needed for \Set
\usepackage{algorithm,algpseudocode}

\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand*{\AddNote}[4]{%
    \begin{tikzpicture}[overlay, remember picture]
        \draw [decoration={brace,amplitude=0.5em},decorate,very thick]
            ($(#3)!(#1.north)!($(#3)-(0,1)$)$) --
            ($(#3)!(#2.south)!($(#3)-(0,1)$)$)
                node [align=center, text width=2.5cm, pos=0.5, anchor=west] {#4};
    \end{tikzpicture}
}%

\begin{document}
\begin{preview}
    \begin{algorithm}[H]
        \begin{algorithmic}
            \Require $Z \in \mathbb{N}_{\geq 0}, b \in \mathbb{N}_{\geq 2}$
            \State $i\gets 0$
            \While{$Z > 0$}
                \State $y_i\gets Z \mod b$
                \State $Z \gets \frac{Z - y_i}{b}$
                \State $i \gets i + 1$
            \EndWhile
            \\
            \State \textbf{Result:} $y_{0} y_{1} \dots y_{i-1}$
        \end{algorithmic}
    \caption{Horner-Schema for changing base for numbers in $\mathbb{N}_0$}
    \label{alg:hornerschemaGanzeZahlen}
    \end{algorithm}
\end{preview}
\end{document}
