The following minimal example shows how to modify the starting line number for an algorithm. Within the algorithmic environment, add the code
\makeatletter\setcounter{ALG@line}{<n>}\makeatother
where <n> is one smaller than the first line number. The reason for this is because the \State command increments the counter first, before typesetting it.
\documentclass{article}
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx
\begin{document}
\begin{algorithmic}[1]
\makeatletter\setcounter{ALG@line}{5}\makeatother
\State Here is some code
\State Here is another line of code
\State And then some more
\end{algorithmic}
\end{document}

This, of course, assumes that you're using the (more advanced) algorithmicx package to typeset your algorithmic environments.
If you would like to make this procedure a little more convenient, it is possible. For example, you can redefine \State to do this for you by providing an optional command:
\documentclass{article}
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx
\usepackage{xparse}% http://ctan.org/pkg/xparse
\let\oldState\State% Store \State in \oldState
\RenewDocumentCommand{\State}{o}{% \State[<num>]
\IfValueTF{#1}{\makeatletter\setcounter{ALG@line}{#1}\addtocounter{ALG@line}{-1}\makeatother}{}%
\oldState\ignorespaces%
}%
\begin{document}
\begin{algorithmic}[1]
\State[8] Here is some code
\State Here is another line of code
\State And then some more
\State[5] and a last line of code
\end{algorithmic}
\end{document}

The interface for redefining \State to \State[<num>] is provided by xparse.
Note that if you plan on breaking up a single algorithmic environment across more than one page, algorithmicx also offers \algstore{<name>} and \algrestore{<name>} options. Here's a short example:
\documentclass{article}
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx
\begin{document}
\begin{algorithmic}[1]
\State Here is some code
\State Here is another line of code
\algstore{myalg}% Save algorithm
\end{algorithmic}
\hrule
\begin{algorithmic}[1]
\algrestore{myalg}% Restore algorithm
\State And then some more
\State and a last line of code
\end{algorithmic}
\end{document}

`to mark your inline code as I did in my edit.:)– Paulo Cereda Oct 15 '11 at 16:08