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

Home > Numbers
888...888 (Posted on 2022-08-02) Difficulty: 3 of 5
Determine the smallest positive perfect cube whose base ten representation begins and ends with 888.

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 Solution | Comment 1 of 10
The required cube is 88831160947109888

If a perfect cube starts and ends with 888, then:
its cube roots start with [207, 446, 961]
its cube roots end with [192, 442, 692, 942]
This narrows down the searching considerably.

I wrote 2 programs, the first just concatenating prefixes and suffixes and the second dealing with additional digits in between.  It turns out the second program was not needed to find the smallest such cube.

The first program yielded:
446192 88831160947109888
961192 888035735381989888
961442 888728833166762888

----------  
for pre in [207, 446, 961]:
    for suff in [192, 442, 692, 942]:
        x = int(str(pre) + str(suff))
        cube= x**3
        if cube % 1000 != 888:
            continue
        if int(str(cube)[:3]) != 888:
            continue
        print(x,cube)
----------  
Further results:
2070942 8881857638766336888
2071192 8885074627659109888
2071442 8888292393248882888
4461442 88802614886488762888
4461692 88817544071564285888
4461942 88832474929774308888
9611942 888041833070348108888
4462192 88847407461212581888
4462442 88862341665972854888
4462692 88877277544148877888
4462942 88892215095834400888
9612192 888111126944361381888
9612442 888180424422946654888

----------  second program ----------  
for i in range(100):
    for pre in [207, 446, 961]:
        for suff in [192, 442, 692, 942]:
            x = int(str(pre) + str(i) + str(suff))
            cube= x**3
            if cube % 1000 != 888:
                continue
            if int(str(cube)[:3]) != 888:
                continue
            print(x,cube)

----------  


  Posted by Larry on 2022-08-02 07:29:55
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 (3)
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