All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Cubing the square (Posted on 2013-01-30) Difficulty: 3 of 5

I'm thinking of a number, x, whose last 3 digits are somewhere between 400 and 500.

You could probably guess from those digits that it might be a square or a cube, but in fact it turns out to be both, and in fact the smallest possible such number.

What are the prime factors of x?

Extra credit: feeling adventurous, I next computed the smallest number, y, having the same last 3 digits, that was a seventh power, as well as a square and a cube.

What are the prime factors of y?

See The Solution Submitted by broll    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Programming and Excel | Comment 4 of 8 |
The program listing below finds that 3^12 [531441] is both a square [3^6] and a cube [3^4] – PART 1.

Although the program uses “double” it still would not have been able to evaluate the end result had “long” been defined as the highest value available is 1.7E+308.

To achieve the desired end the program works with truncated values repeating these until a 7th power is achieved which meets the demands of being a square, a cube and terminating in 1441.

One can achieve a lengthier table similar to PART 2 with Excel:

              ColA           
Row1  =IF(INT(B1/7)=B1/7,INT(B1/7),””)  
              ColB       ColC   ColD     ColE
                 12       1441    531441   =RIGHT(D1,4)
Row2     ColA
             [copy formula in A1]
             ColB        ColC   ColD        ColE
            = B1+12   1441   =C1+C2   [copy formula in E1]

Copying contents of Row2 down to Row126 yields:
216    1512  1441  1441  1441.

Without further comment on it I‘ll leave the reader to contemplate that table.

1512 = 7 * 216   1512 =  2 * 756 and 1512 = 3 * 504 so we have:

7 * (3^216), 2 * (3^756) and  3* (3^504) which all equal 3^1512.

The highest value Excel will handle here is 3^646 = 1.6609E+308.

3^1512 = 3^600 * 3^600 * 3^312
or     = (1.8739E+286)* (1.8739E+286)*(7.275E+148)
         = 2.5545E+721




PART 1
* 729         s 531441      cr 81


PART 2
   12      84  1441  5681 5681
   24    168  1441  3761 3761
   36    252  1441  6241 6241
   48    336  1441  5121 5121
   60    420  1441  2401 2401
   72    504  1441     81 0081
   84    588  1441   161 0161
   96    672  1441  4641 4641
 108    756  1441  5521 5521
 120    840  1441  4801 4801
 132    924  1441  4481 4481
 144  1008  1441  6561 6561
 156  1092  1441  3041 3041
 168  1176  1441  5921 5921
 180  1260  1441  7201 7201
 192  1344  1441  8881 8881
 204  1428  1441  2961 2961
 216  1512  1441  1441 1441





OPEN "c:\qb64\work\br_cube.txt" FOR OUTPUT AS #1

DEFDBL A-Z
n = 2: done = 0
DO
 LOCATE 1, 50: PRINT n
 s = n * n
 PRINT n, s ^ (1 / 3), INT(s ^ (1 / 3))
 cr = INT(s ^ (1 / 3) + .5)
 IF s = cr * cr * cr THEN
  crval$ = RIGHT$(STR$(s), 3)
  IF VAL(crval$) > 400 AND VAL(crval$) < 500 THEN
   ' PRINT s ^ (1 / 2), s ^ (1 / 3)
   PRINT "*"; n, "s"; s, "cr"; s ^ (1 / 3)
   PRINT
   PRINT #1, "Part 1"
   PRINT #1, "*"; n, "s"; s, "cr"; s ^ (1 / 3)
   PRINT #1,
   PRINT #1,

   done = 1
  END IF
 END IF
 n = n + 1
LOOP WHILE done <> 1
done = 0
REM PART 2

y = 1
tm = 1441
done = 0
n = 0
PRINT #1, "PART 2"
DO
 n = n + 12
 y = y * tm
 term$ = RIGHT$(STR$(y), 4)
 y = VAL(RIGHT$(STR$(y), 4))
 IF INT(n / 7) = n / 7 THEN
  PRINT n / 7; n; 1441; y; term$
  PRINT #1, n / 7; n; 1441; y; term$
 END IF
 IF INT(n / 7) = n / 7 AND RIGHT$(term$, 3) = "441" THEN


  done = 1
 END IF

 '' DO
 ''LOOP WHILE INKEY$ <> CHR$(32)
LOOP WHILE done <> 1
CLOSE 1


  Posted by brianjn on 2013-01-30 17:37:24
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (14)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information