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

Home > Numbers
Cube + Single Digit = Perfect Square (Posted on 2024-01-21) Difficulty: 3 of 5
Which is the highest cube n^3 < 108 that can be incremented by a single digit from 1 to 9 to yield a perfect square?

For example, 8 is a perfect cube. When incremented by 1 it becomes 81, which is a perfect square.

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.)
Solution computer solution | Comment 1 of 2
hv=10^(8/3)
for n=1:hv
  cu=n^3;
  for d=1:9
    sq=cu+d;
    sr=round(sqrt(sq));
    if sr^2==sq
      fprintf('%5d %5d %3d %8d %4d\n',n, cu, d, sq, sr)
    end
  end
end

finds

hv =
          464.158883361278
    1     1   3        4    2
    1     1   8        9    3
    2     8   1        9    3
    2     8   8       16    4
    3    27   9       36    6
    6   216   9      225   15
   40 64000   9    64009  253
   46 97336   8    97344  312
   
indicating the program checked n through 464^3 = 99,897,344 and found the above, so the highest is 46^3 = 97,336. When 8 is added it becomes 97,344, which is 312^2.

  Posted by Charlie on 2024-01-21 12:39:47
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 (10)
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