Neither All? What's Left?

How many integers from 1 \displaystyle 1 to 1 0 6 \displaystyle 10^{6} inclusive are neither perfect squares nor perfect cubes nor perfect fourth powers?

Enter your answer as the digit sum of the required number. For example the digit sum of 1729 = 1 + 7 + 2 + 9 = 19 1729 = 1+7+2+9=19

For more problems ,click here .


The answer is 36.

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.

3 solutions

Sravanth C.
Mar 17, 2015

for each integer n from 1 to 1000 there is a number n 2 n^2 that is a perfect square less than or equal to 1,000,000 so there are 1000 perfect squares

for each integer m from 1 to 100 there is a number m 3 m^3 that is a perfect cube that is equal to or less than 1,000,000 so there are 100 perfect cubes

how many of these perfect cubes are also perfect squares?

integers raised to the sixth power will be both perfect squares and perfect cubes; there are ten of these ( 1 6 , 2 6 , 3 6 , . . . 1 0 6 ) (1^6, 2^6, 3^6, ...10^6) that produce numbers in this range

so there are 1000 + 100 - 10 = 1090 separate numbers that are either perfect squares or cubes in the given range

meaning that 1,000,000 - 1090 = 998,910 are neither perfect squares or cubes

Brock Brown
Mar 17, 2015

Python 2.7:

1
2
3
4
5
6
7
8
perfect = {2:set(),3:set(),4:set()}
for power in xrange(2,5):
    new = 0
    while new**power < 1000000:
        perfect[power].add(new**power)
        new += 1
count = 10**6 - len(perfect[2] | perfect[3] | perfect[4])
print "Answer:", sum([int(c) for c in str(count)])

Vaibhav Prasad
Mar 17, 2015

Number of perfect squares = 1000 1000 Since we know that 1000 2 = 10 6 {1000}^{2} = {10}^{6}

Number of perfect cubes = 100 100 Since we know that 100 3 = 10 6 {100}^{3} = {10}^{6} But we have already counted 1 1 hence we have 99 99

Number of perfect fourth powers = 31 31 Since 31 4 {31}^{4} is the closest to 10 6 {10}^{6} But we have already counted these fourth powers in the squares. Hence we have 0 0

Total = 1000 + 99 + 0 = 1099 1000 + 99 + 0 = 1099

10 6 1099 = 998901 {10}^{6} - 1099 = \boxed {998901}

9 + 9 + 8 + 9 + 1 = 36 9 + 9 + 8 + 9 + 1 = \boxed {\huge 36 }

You need to consider the cases when n 2 = m 3 n^2 =m^3

Vishnu Bhagyanath - 5 years, 11 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...