# Integer Square Roots of P{0,1,2,4,5,6,7,8,9}

• I
• bob012345
bob012345
Gold Member
TL;DR Summary
Can it be proven that there are no integer square roots among the numbers of the set P{0,1,2,4,5,6,7,8,9}?
This is not homework but just a mental exercise. I suspect there are no integer square roots in this set but can't prove it. I mean all digits are used once in each number. I am interested in arguments from principal and not algorithms. Note the number ##3## is missing. Thanks.

Last edited:
Maybe I'm not understanding your question, but 1, 4, and 9 are in the set and all have integer square roots. If you're thinking something else, please clarify what you're doing.

Mark44 said:
Maybe I'm not understanding your question, but 1, 4, and 9 are in the set and all have integer square roots. If you're thinking something else, please clarify what you're doing.
Sorry, I mean numbers using all nine digits such as 201456789 for example. All permutations of nine digit numbers where each digit is used only once. Cases where the zero is first are 8 digit numbers.

DaveC426913 said:
The similar problem with digits 1...9 does have integer square roots. I think having a zero replace the number 3 restricts the possibilities.

OK, it's just that it's not the PF way to start handing out answers without the poster first showing their own attempts and/or research. But that's just my take.

Last edited:
bob012345
DaveC426913 said:
OK, it's just that it's not the PF way to start handing out answers without the poster first showing their own attempts and/or research. But that's just my take.
I realize that but it's not a homework problem or assignment and I spent some time on it. I can do this, let the letters ##a,b,c,d,e## represent unknown digits then we have; $$(a,b,c,d,e)(a,b,c,d,e)=(a^2,2ab,2ac+b^2,2ad+2bc,2ae+2bd+c^2,2be+2cd,2ce+d^2,2de,e^2)$$ maybe I can use logic to eliminate possibilities. For example, if ##e=0##, there will be two zero's in the answer which is forbidden. If any combination of candidate digits yield a 3 that combination is forbidden. I can see there are a lot of rules here like ##a≠9## which has too many digits, ##a≠e## ect...

Last edited:
Oh, also it is only the square that has no 3 and no repeated digits. The square roots have no limitations. Still we have to eliminate ##\frac{9!}{3}=120960## possibilities. Update: I got it down to only 21622 possibilities.

Last edited:
bob012345 said:
I realize that but it's not a homework problem or assignment and I spent some time on it. I can do this, let the letters ##a,b,c,d,e## represent unknown digits then we have; $$(a,b,c,d,e)(a,b,c,d,e)=(a^2,2ab,2ac+b^2,2ad+2bc,2ae+2bd+c^2,2be+2cd,2ce+d^2,2de,e^2)$$
But don't the numbers you're asking about have 9 digits (including a possible leading 0 digit)? Why are you using only 5 digits?

bob012345 said:
maybe I can use logic to eliminate possibilities. For example, if ##e=0##, there will be two zero's in the answer which is forbidden. If any combination of candidate digits yield a 3 that combination is forbidden. I can see there are a lot of rules here like ##a≠9## which has too many digits, ##a≠e## ect...
Nit -- the abbreviation for et cetera is etc., not ect.

Mark44 said:
But don't the numbers you're asking about have 9 digits (including a possible leading 0 digit)? Why are you using only 5 digits?Nit -- the abbreviation for et cetera is etc., not ect.
We are trying to determine if a nine digit number with the restrictions above can have an integer square root. For example the number 102456789 has square root 10122.094..... so it doesn't work. Also squaring 10121 gives 102434641 which doesn't work because it repeats digits 1,4 and has a 3 as well which violate my rules. I only need one counterexample to disprove my suspicion. The only rule on the square root itself is that it be an integer and it has to have five digits to make a nine digit square.

Last edited:
bob012345 said:
For example the number 102456789 has square root 10122.094.
I can see how you came up with 102456789, but you do realize that there are 9! = 362,880 different permutation of the digits in your set, right? Do you plan to check them all by what seems to be a brute force approach?

Mark44 said:
I can see how you came up with 102456789, but you do realize that there are 9! = 362,880 different permutation of the digits in your set, right? Do you plan to check them all by what seems to be a brute force approach?
Actually a lot can be eliminated. So far, I got it down to 21,623 possibilities. Those are the only possible integer roots that will make a nine number square.

Well, we can dismiss all numbers ending with 2 , 7 or 8 there are 3(8!) =120960 of them, a third of the total , and then we have a total of 241920 left. Then we consider those starting with 0.

Last edited:
bob012345
bob012345 said:
Actually a lot can be eliminated. So far, I got it down to 21,623 possibilities. Those are the only possible integer roots that will make a nine number square.
You can check all the possibilities quickly if you turn it around and square all integers between the lower and upper possible limits. I used Python to check there are none. I checked for both 8-digit numbers that were a permutation of the digits 1-9, except 3. And for 9-digit numbers, whose digits were a permutation of the digits 0-9, except 3. These programs took less than a second to run.

To check the code worked, I looked for integers whose square was a permutation of the digits 1-9. The lowest possible integer is 11, 112 (which is approx ##\sqrt{123456789}##) and the highest is 31427 (which is approx ##\sqrt{987654321}##). The list of integers and their squares is:

11826 139854276
12363 152843769
12543 157326849
14676 215384976
15681 245893761
15963 254817369
18072 326597184
19023 361874529
19377 375468129
19569 382945761
19629 385297641
20316 412739856
22887 523814769
23019 529874361
23178 537219684
23439 549386721
24237 587432169
24276 589324176
24441 597362481
24807 615387249
25059 627953481
25572 653927184
25941 672935481
26409 697435281
26733 714653289
27129 735982641
27273 743816529
29034 842973156
29106 847159236
30384 923187456

bob012345
PS if we look for other cases, where we omit one digit and look for 9-digit numbers that are a permutation of the rest, then;

With the digit 1 missing: none.

With the digit 2 missing:

12586 158407396
13343 178035649
14098 198753604
17816 317409856
21397 457831609
21901 479653801
23728 563017984
28256 798401536
28346 803495716

With the digit 3 missing: none.

With the digit 4 missing: none

With the digit 5 missing:
10136 102738496
13147 172843609
13268 176039824
16549 273869401
20513 420783169
21877 478603129
25279 639027841
26152 683927104
27209 740329681
28582 816930724

With the digit 6 or 7 missing: none.

With the digit 8 missing:

10124 102495376
10214 104325796
14743 217356049
15353 235714609
17252 297631504
20089 403567921
21439 459630721
22175 491730625
22456 504271936
23113 534210769
26351 694375201
28171 793605241

With the digit 9 missing:

10128 102576384
10278 105637284
12582 158306724
13278 176305284
13434 180472356
13545 183467025
13698 187635204
14442 208571364
14766 218034756
16854 284057316
17529 307265841
17778 316057284
20754 430728516
21744 472801536
21801 475283601
23682 560837124
23889 570684321
24009 576432081
27105 734681025
27984 783104256
28731 825470361
29208 853107264

bob012345
Here's the code:

Python:
check_str = ['1', '2','3', '4', '5', '6', '7', '8', '9']
#
for k in range(10117, 31427):
k2 = str(k**2)
sorted_k2 = sorted(k2)
#
if sorted_k2 == check_str:
print(k, k**2)

bob012345
There are weaker results , positives , if you just consider squares using a strict subset of the set of numbers given. ##1017^2=1034289, 1023^2=1046529, 1027^2=1054729, 1028^2=1056784##.

bob012345
PeroK said:
You can check all the possibilities quickly if you turn it around and square all integers between the lower and upper possible limits. I used Python to check there are none. I checked for both 8-digit numbers that were a permutation of the digits 1-9, except 3. And for 9-digit numbers, whose digits were a permutation of the digits 0-9, except 3. These programs took less than a second to run.

To check the code worked, I looked for integers whose square was a permutation of the digits 1-9. The lowest possible integer is 11, 112 (which is approx ##\sqrt{123456789}##) and the highest is 31427 (which is approx ##\sqrt{9
Thanks. I used the upper and lower limits to reduce the number of possibilities as well as logic. For example there are only 21,623 possibilities based on limits but that can be reduced to 7,344 by noticing the values of the digits of the possible roots are constrained as well in various ways. Ramanujan would probably have just looked at it and said why it's impossible.

Last edited:
A friend gave me a rule that seems to work. If the sum of the digits is divisible by 3 but not by 9, there are no permutations of those digits that make a perfect square. If it's not divisible by either, it's indeterminate. If it's divisible by both, it's indeterminate.

bob012345 said:
A friend gave me a rule that seems to work. If the sum of the digits is divisible by 3 but not by 9, there are no permutations of those digits that make a perfect square. If it's not divisible by either, it's indeterminate. If it's divisible by both, it's indeterminate.
That's not hard to prove. A number is divisible by 3 iff the sum of its digits is divisible by 3. And divisible by 9 iff the sum of its digits is divisible by 9. This follows from 10 being 1 modulo 3 and 9.

If a number is divisible by 3 and not by 9, then it's not a perfect square. That holds for any prime number.

bob012345
PeroK said:
This follows from 10 being 1 modulo 3 and 9.
Is that New Math?

PeroK said:
This follows from 10 being 1 modulo 3 and 9.

bob012345 said:
Is that New Math?
No, it's number theory, which has been around for a lot longer than so-called "New Math."

PeroK
bob012345 said:
Is that New Math?
It's not an original result, I'm sorry to say.

PeroK said:
It's not an original result, I'm sorry to say.
'New Math' was an American term from the 1960's when the U.S. changed the math teaching style and the new style confounded and confused both teachers and parents.

Last edited:

Replies
4
Views
964
Replies
2
Views
1K
Replies
1
Views
2K
Replies
12
Views
2K
Replies
1
Views
1K
Replies
13
Views
4K
Replies
7
Views
1K
Replies
1
Views
1K
Replies
3
Views
1K
Replies
7
Views
2K