Yeah, I just got around to working that out
Here's my version.
N = 1,000,000
n1 = √N = 1000 => there are 1000 numbers, the integers for 1 to 1000 inclusive, that have squares less than, or equal to, 1,000,000.
n2 = ³√N = 100 => there are 100 numbers, the integers for 1 to 100 inclusive, that have cubes less than, or equal to, 1,000,000.
let n,m be integers s.t. n² <= 1,000,000 and m³ <= 1,000,000.
n and m are constrained by having n=k³ and m=k²
=> k^6 = 1,000,000
=> k<=10
=======
In other words, all the integers form 1 to 10 inclusive can be taken to the sixth power and be less than or equal to 10^6.
And each one of these numbers, to the sixth power, can have a square root and a cube rooot.
So there are 10 duplicates in our list of squares and cubes.Total number of integers <= 1,000,000 which are squares or cubes is,
n = n1 + n2 - 10
n = 1000 + 100 - 10
n = 1090
======