prime generator from book