# Remove line numbering from algorithmicx procedure/function

I would like the lines of "procedure" and "end procedure", "function", and "end function" etc to not be numbered.

For example, the default behavior produces this:

1 procedure hasNext(v,V,s)
2  solution <-- findSolution()
3 end procedure


but I would like to have this:

  procedure hasNext(v,V,s)
1    solution <-- findSolution()
end procedure


Is this possible?

The following is a workaround, since this package does not seem to provide any option to show this behavior.

The \Procedure and \EndProedure control sequences are replaced by \Statex, which results in a line not being numbered. The drawback is that the procedure markup needs to be inserted by hand.

\documentclass{article}
\usepackage{algpseudocode}

\begin{document}

\begin{algorithmic}[1]
\Statex{{\bf procedure} Euclid ($a,b$)}\Comment{The g.c.d. of a and b}
\State $r\gets a\bmod b$
\While{$r\not=0$}\Comment{We have the answer if r is 0}
\State $a\gets b$
\State $b\gets r$
\State $r\gets a\bmod b$
\EndWhile\label{euclidendwhile}
\State \textbf{return} $b$\Comment{The gcd is b}
\Statex{\bf end procedure}
\end{algorithmic}

\end{document}