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

Home > Numbers
Double the Digits (Posted on 2023-09-28) Difficulty: 3 of 5
The binary integer 110101 has 2 zeroes and 4 ones. Its square 101011111001 has double that, namely 4 zeroes and 8 ones.

Similarly, the ternary integer 20211 has 1 zero, 2 ones and 2 twos. Its square 1201102221 has double that, namely 2 zeroes, 4 ones and 4 twos.

Find the first 3 decimal (base ten) integers with this property.

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 2 of 2 |
Here are the first several:
  n       n^2
72576 5267275776
406512 165252006144
415278 172455817284
494462 244492669444
603297 363967270209
725760 526727577600

-------------
sqrt_of_10 = 10**.5

for digits in range(1,7):
    lo = 1+int(sqrt_of_10*(10**(digits-1)))
    for n in range(lo, 10**(digits)+1):
        string1 =  ''.join(sorted(str(n**2)))
        string2 =  ''.join(sorted(str(n)*2))
        if string1 == string2:
            print(n, n**2)

  Posted by Larry on 2023-09-28 11:12:02
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