Another sieve method and the time lasts 13s really long and take care of the memory it uses think of some better way.