2
$\begingroup$

State the number of positive integers in the range of 1 to 'x' which are perfect squares or cubes or perfect fourth powers of an integer.

My try It would be helpful to find the square root of the nearest perfect square to x and hence know the number of perfect squares . Same could be done with cubes and perfect fourth powers.However , there are some numbers which are both or all three of them and hence would be repeated. E.g. - 1, 64 . Is there another approach to such a problem ?

$\endgroup$
2
$\begingroup$

The number of perfect squares less than $x$ is $\lfloor\sqrt{x}\rfloor$. Similarly for cubes, we use $\lfloor\sqrt[3]{x}\rfloor$. The only ones that have been double-counted are the sixth powers, and there are $\lfloor\sqrt[6]{x}\rfloor$ many of those. There is no need to count perfect fourth powers, because those are all squares, and have thus already been counted. Thus, if you want to count how many perfect powers are less than or equal to $x$ of degree $2,3$ or $4$, your number is: $$\lfloor\sqrt{x}\rfloor + \lfloor\sqrt[3]{x}\rfloor - \lfloor\sqrt[6]{x}\rfloor$$

Does this work?

$\endgroup$
  • 2
    $\begingroup$ In general, the Principle of Inclusion and Exclusion would apply, but since the fourth powers are a subset of the squares, the problem can be simplified to just the sum of the individual cardinalities minus the overlap. $\endgroup$ – Acccumulation Nov 13 '17 at 17:51
  • $\begingroup$ How can I prove that numbers which are both perfect squares as well as perfect cubes have to be perfect sixth powers ? $\endgroup$ – user488460 Nov 13 '17 at 19:12
  • 1
    $\begingroup$ @user488460, yes. A perfect $n$th power has the property that all exponents in its prime factorization are multiples of $n$. If a number is a square and a cube, then each exponent is an even multiple of $3$, i.e., a multiple of $6$. $\endgroup$ – G Tony Jacobs Nov 13 '17 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.