Popular Posts

Tuesday, February 14, 2012

Count the number of numbers up to n which are both square and cube


Count the number of numbers up to n which are both square and cube.
e.g., for 1 < n < 1000 answer is 2 (64, 729)

The numbers 0 and 1 are self-squares and self-cubes, all exponentials being 0 and 1 respectively. Only a few other numbers are both squares and cubes of integers.

For any given square and cube, the numerical relation is n3 = [n(sqrt n)]2
so for the value n where (sqrt n) is whole number, the cube of n is also a square.
After 0 and 1, the next 4 are 64, 729, 4096, and 15625.

64 = 43 = 82 . (4x2)2
729 = 93 = 272 . (9x3)2
4096 = 163= 642 . (16x4)2
15625 = 253 = 1252 . (25x5)2

You can find the others easily. There are each the sixth power of any integer,
such that x6 = (x2)3 = (x3)2 e.g. 26 = 64, 36 = 729, 46 = 4096, etc. - Besides 64, another easy one is the number one million, 106, which is 1003 and 10002.

We can say that these numbers are the cube of a square, or the square of a cube, for any given integer.

No comments:

Post a Comment