Discrete Math Find the number of positive integers not excee
Discrete Math:
Find the number of positive integers not exceeding 1000 that are either the square or the cube of an integer.
Solution
We need to find the number of integers that are either square or cube of an positive integer
First case: Let the number be a
then condition is a^2 <= 1000 => a < (1000)^(1/2) = 31.622
a belongs to the integers in the group [1,31] => Set A
other condition is a^3 <= 1000 => a < (1000)^(1/3) = 10 => a<=10 = > Set B
Set A contains 31 elements
Set B contains 10 elements
A (int) B = 3 [ i.e. 1^3,4^3 and 9^3 are also squares]
Hence AUB = A + B = A(int)B = 31 + 10 - 3 = 38 elements
Hence the correct answer is 38 elements
Please rate five stars for the answer
