%------------------------------------------
% Algorithm: Packet size : PACKETSIZE_ALG
%------------------------------------------
\begin{algorithm}[h]
    \centering
    \small
    \caption{Prints out each odd number from $0\rightarrow n-1$ in
	unary, and $n$ in decimal.} 
    \begin{algorithmic}[1]
        \REQUIRE
	    $n$, an integer number where $n \geq 1$
	\ENSURE
	    Prints out each odd number from $0 \rightarrow n-1$ in unary.\\
	    Prints out $n$ in decimal.
	\FOR{$i \leftarrow \left[0, n \right]$}
	    \IF{$i = n$}
		\PRINT Emit $i$ to the stream.
	    \ELSIF{$i \% 2 != 0$}
		\STATE
		    \COMMENT{Then $i$ is odd.}
		\STATE
		     $j \leftarrow i$
		\WHILE{$j \geq 0$}
		    \STATE
		    Emit $1$ to the stream.
		    \STATE
		    $j \leftarrow j - 1$
		\ENDWHILE				
	    \ELSE[Then $i$ is even.]
		\STATE
		\COMMENT{Print nothing!}
	    \ENDIF
	\ENDFOR
    \end{algorithmic}
    \label{alg:EXAMPLE_ALG}
\end{algorithm}
