% -*- latex -*-
% FILE: "/home/evmik/jobs/wm/2015_fall_practical_computing_for_scientists/hw11/hw11.tex"
% LAST MODIFICATION: "Mon, 23 Nov 2015 12:35:47 -0500 (evmik)"
% (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com>
% $Id:$
\documentclass[letter,12pt]{article}

%---------------------------------------------------------------
\usepackage{listings}
\usepackage{color}
\usepackage{fullpage}
%---------------------------------------------------------------

\begin{document}
\newcommand{\problem}[1]{%
	{\flushleft  \bf #1\\}
}
\newcommand{\hw}[1]{%
	\begin{center}
		\Large  \bf Homework #1%
	\end{center}%
}
\newcommand{\mat}[1]{% matlab code
{\color{blue}\texttt{#1}}%
}

%---------------------------------------------------------------
\hw{11}

This homework is {\bf optional}. In case of completion the points will be
added to the total of all homeworks.

General comments: 
\begin{itemize}
	\item Do not forget to run some test cases. 
\end{itemize}


\problem{Problem 1 (15 points max)}
%---------------------------------------------------------------
The prime number is the integer which is divisible only  by 1 and itself.
We exclude 1 from the prime numbers list.

Write a function ``primes\_after'' according to the following specification
\begin{lstlisting} [language=matlab]
function PrimeNumbersList = primes_after(N, M)
\end{lstlisting}
which outputs a {\bf row} vector of M prime numbers starting from N 
(inclusive). N and M are guaranteed to be positive integer numbers, no checks 
for this are necessary.  Make sure your function follows the specification
above {\bf exactly}.

Examples:
\begin{lstlisting} [language=matlab]
>> primes_after(7,2);
ans=[ 7, 11 ]
>> primes_after(1,2);
ans=[ 2, 3 ]
\end{lstlisting}

In our speed comparison tests, 
$M$ will be in order of a $10^6$ , and $N$ will be  something like $10^9$ or even more.

\begin{itemize}
	\item 
		If you do the function right you will get only 5 points.
		I.e., it follows the specification and outputs valid results.
	\item 
		You will get extra 5 points if your algorithm is the fastest in the class.
	\item 
		You will get extra 5  points if your algorithm is faster
		than the instructor one.
	\item 
		We will run the competition during the practice section.
\end{itemize}



%---------------------------------------------------------------
\end{document}
%---------------------------------------------------------------
