The problem is as follows:
Quote
My challenge is just a bit harder than that. I want you to make a function which computes this for arbitrary limits on a and b; so to restate it
Create a function that accepts X and Y as arguments and computes the number of distinct terms in the sequence generated by a^b for 2 <= a <= X and 2 <= b <= Y.
X and Y can just be an int.
The easy solution is to create a set of big numbers and check how large the set is after you have computed each of the numbers. However C++ doesn't have a big integer class in the standard library and creating one is a bit complicated. There are more clever ways to solve this however, can you find one?
After a couple people post solutions, I'll post my solution.
This post has been edited by ishkabible: 22 May 2012 - 04:18 PM

New Topic/Question
Reply






MultiQuote






|