How many integers from 1 to 1 0 6 (inclusive) are neither perfect squares nor perfect cubes nor perfect fourth powers?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
10/10 solution
Bingo! Great solution...
First, count how many integer perfect squares, cubes and fourth powers are there between 1 and 1000000. Counting with Mathematica into three lists:
squares := { }
cubes := { }
quadroes := { }
For [ n = 1 , n ≤ 1 0 6 , n ++ ,
k = n ;
l = 3 n ;
m = 4 n ;
If [ IntegerQ [ k ] = True , AppendTo [ squares , n ] ] ;
If [ IntegerQ [ l ] = True , AppendTo [ cubes , n ] ] ;
If [ IntegerQ [ m ] = True , AppendTo [ quadroes , n ] ] ]
Then, to count how many of the integers between 1 to 1000000 are neither perfect squares nor perfect cubes nor perfect fourth powers, substract the union of the lists "squares", "cubes" and "quadroes" from the total number of integers between 1 and 1000000:
1 0 0 0 0 0 0 − Length [ squares ∪ cubes ∪ quadroes ] = 9 9 8 9 1 0
Problem Loading...
Note Loading...
Set Loading...
Of our 10^6 starting values... There are 1000 values that are perfect squares. (1^2 to 1000^2) There are 100 values that are perfect cubes, (1^3 to 100^3) however 10 of these [ a perfect square that is then cubed] can also be expressed as square numbers. For example 4^3 = (2^2)^3 = (2^3)^2 = 8^2 so need to be excluded from the count as it has already been included in the line above, leaving 90 perfect cubes that are not square. Though there are 31 perfect forth powers, (1^4 to 31^4), each of these can be expressed as a perfect square, previously accounted for; so need not be considered. eg 31^4 = (31^2)^2 < 961^2
From the 1,000,000 starting integers 1090 have been identified as powers of 2, 3, or 4 leaving 998910 integers that are therefore not powers of 2, 3 or 4.