Performs various mathematical operations on numbers using different threads.