all_to_number method - returns all prime number from 1 to given input
parameter