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

Home > Numbers
Cube Difference Deduction II (Posted on 2022-10-22) Difficulty: 3 of 5
Consider these nine positive integers:
987654321, 98765432, 9876543, 987654, 98765, 9876, 987, 98 and 9

Determine how many of these are expressible as the difference of cubes of two integers.

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

Comments: ( Back to comment list | You must be logged in to post comments.)
re(2): soln Comment 3 of 3 |
(In reply to re: soln by K Sengupta)

Thanks for the generous hint. Right, the possibility of negative integers. I missed that. 


If we arrange the two cubes in ascending order: n^3,  (n+m)^3, then m will be positive, no matter the sign of n. In the previous post I considered n and m positive. Now we include the two remaining cases. Case #1: n negative and (n+m) negative, and Case #2: n negative and (n+m) positive.

Case #1 Using both negative cube roots is symmetric about the origin to using both positive cube roots. The only solution for the positive integers was:
(+5)^3 - (+3)^3  = 98 
This maps into the only solution for the negative integers: 
(-3)^3 - (-5)^3 = 98  

Case #2 Subtracting a negative integer cubed is identical to adding 
the absolute value of that integer cubed, so we are really now asking if any of the values supplied is the sum of two cubes. Doing a quick search, we find only one pair: 9 = 1 + 8. In terms of the problem: 
2^3 - (-1)^3 = 9  

What is nice about using the m^3 + 3(m n^2 + m^2 n) search  (see the first post) and also using the sum of cubes search, is that we can be sure we found all (three) solutions. 

The code is here.

lord@rabbit 12754 % difc1              

    987654321 no solution

     98765432 no solution

      9876543 no solution

       987654 no solution

        98765 no solution

         9876 no solution

          987 no solution

           98 = ( 5)^3 - ( 3)^3

           98 = (-3)^3 - (-5)^3

            9 = ( 1)^3 - (-2)^3

lord@rabbit 12754 % 

Edited on October 24, 2022, 3:15 am
  Posted by Steven Lord on 2022-10-23 01:49:04

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 (9)
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