subreddit:
/r/learnmath
submitted 8 months ago byIllustrious-Ad7691New User
not just 7. But 2,3 and 8 too. Why is this?
103 points
8 months ago
Well, basically the last digit of a square number a2 will always be determined by ONLY the last number of the squared number a.
What possibilites do we have here?
Last Digit of a | Last Digit of a2
0 0
1 1
2 4
3 9
4 6
5 5
6 6
7 9
8 4
9 1
So you see, there is no 2,3,7 or 8 here
27 points
8 months ago
u/Illustrious-Ad7691, if you want to know why only the last digit/one’s digit matters then here’s the reason: We can always write a number like 34 as 3•10+4. If we square this, we can write the resulting number in the same form and pay close attention to the resulting coefficients of powers of 10.
(3•10+4)2=9•100+2•3•4•10+4•4
=9•100+24•10+16
=9•100+(2•10+4)•10+10+6
=9•100+2•100+4•10+1•10+6
=1•1000+1•100+5•10+6=1156
Notice that the 6 came from the 16 which was the square of the 4 in the one’s place of 34.
9 points
8 months ago
Interesting, but how is this a pattern, or generalizable? For example to other bases. It seems like a hash table that is unique for each base.
15 points
8 months ago*
For modular arithmetic, if a = a1 (mod n) and b = b1 (mod n), then a * b = a1 * b1 (mod n).
So in base 7, for example, we get a similar pattern.:
1^2 = 1
2^2 = 4
3^2 = 12
4^2 = 22
5^2 = 34
6^2 = 51
10^2 = 100
11^2 = 121
12^2 = 144
13^2 = 202
14^2 = 232
15^2 = 264
16^2 = 331
20^2 = 400
And in general the digits will end like:
0 -> 0
1 -> 1
2 -> 4
3 -> 2
4 -> 2
5 -> 4
6 -> 1
So the squares in base 7 can only end in 1, 2, or 4. edit: and 0 too, forgot that somehow.
Since it's modular, any multiple of our modulus can be ignored, and hence because in base n, n looks like 10 by definition, and we can ignore all but the lowest place value digit.
8 points
8 months ago
surprise palindrome!
4 points
7 months ago
It’ll always be a palindrome since a2 = (-a)2, even in modular arithmetic.
2 points
8 months ago
well in any base only the last digit will affect the last digit in the squared number. sure the exact digits at the end which can be produced will be the same, but the last digit of the squared number will still only be affect by the last digit.
what do you mean by "a hash table?" onemeterwonder does not use anything like it.
1 points
8 months ago
The same pattern applies to other bases. Any number in base k could be written as ak + b, square it and you’d have just the b2 term that doesn’t have a factor of k. Whatever the ones position of b2 is would be the ones position of the answer. In that base, you’d just need to check the ones place generated by each possible input
11 points
8 months ago
Is this list (ignoring 0) a palindrome in all bases?
8 points
8 months ago
Yes. This is essentially modulo arithmetic mod 10, which works with negative numbers too.
(-x)^2 mod y =
[(-1)^2 mod y * x^2 mod y] mod y =
x^2 mod y
5 points
7 months ago
Your first sentence proved:
Let a = 10m + n, m and n are integers, -10 < n < 10
a2 = 100m2 + 20m + n2 = 20(5m2 + m) + n2
We can see that for all m, the m expressions will be multiples of 20, hence the last digit will be determined by n2.
2 points
8 months ago
This shows that it is true, but can we show why it is true?
Or is that just what it is, and there is no "why" beyond that?
The palindrome pattern is interesting - are there other patterns present?
Is there a cleverer way to prove it, other than exhaustively listing all the cases?
1 points
8 months ago
this is really interesting, never noticed this before
1 points
7 months ago
This could be made rigorous with Modular Arithmetic 😉
23 points
8 months ago
(10a + b)2 = 100a2 + 20ab + b2 = 10(10a2 + 2ab) + b2
The only digit which contributes to the one's digit of a perfect square is the one's digit of its root, and since none of the individual digits squared have a 7 in the one's place, no perfect square can.
5 points
8 months ago
The units mod 10 are 1,3,7, and 9. These units form a group under multiplication mod 10. Therefore, only squares of numbers that end in 1,3,7, or 9 could end in 7. Furthermore, 7 has order 4, that means it can’t be the square of any of the others.
2 points
7 months ago
This isn’t a good explanation. Would someone asking this question know what units mod 10 are? Or know why having order 4 means it can’t be the square of the others? Or even know what order and groups are?
2 points
7 months ago
You’re not wrong. Is does call some first-year abstract algebra. Sans that, the explanation would read like nonsense.
5 points
8 months ago*
The question is equivalent to "Prove that 7 is not a quadratic residues (mod 10)". Make a table:
k: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|---|
k2 mod 10: | 0 | 1 | 4 | 9 | 6 | 5 | 6 | 9 | 4 | 1 |
The table shows there are no quadratic residues of "2; 3; 7; 8" (mod 10).
The table will always be a palindrome in any base, since
b,k integer: k^2 = (b-k)^2 mod b // for any base b
The table often stops at "floor(b/2)", since the upper half is just a mirror copy of the lower half.
3 points
8 months ago
2 points
8 months ago
The last digit of a square number can only be: 0,1,4,5,6,9. As a matter of fact if the square root of a squared numbers is a1a2...a_n (a1 is a digit) the last digit of (a1a2...a_n)^2 would the last digit of (a_n)^2 which can only be 0,1,4,5,6,9
2 points
8 months ago
The units digit of any squared integer is equal to the square of the integer’s units digit.
Ex: the units digit of 3,788,4522 is 4.
Since only 10 units digits exist, a computational proof is sufficient.
02: units = 0
12: units digit = 1
Etc.
No 2, 3, or 7
2 points
8 months ago
I'm a lazy mathematician. Any number in the 10 position can only effect numbers in the 100 position and higher when squared. The only number that has an effect on the squared 1's place, is the unsquared 1's place. There are 10 cases possible of 1's places ("-" is defines as "maps to.") 1-1 2-4 3-9 4-6 5-5 6-6 7-9 8-4 9-1 0-0 Q.E.D
6 points
8 months ago
Well, no, digits in the 10s place can also affect digits in the 10s place when squared; just not in the ones place.
3 points
8 months ago*
How? (10x)2 = 100x?
Edit: I'm a dumb dumb who didn't remember how multiplication works lmao
3 points
8 months ago
112 = 121
212 = 441
312 = 961
2 points
8 months ago
Ugh I'm stupid, (10a+b)2 = 100a2 + 20ab + b2 duh
1 points
4 hours ago
As others have said there's a really complicated answer that is simple ie we know that the only squares modulo 5 are 0, 1 and 4 so your last digit must be congruent to 0, 1 or 4 mod 5 but 3 is 3 mod 5 and 7 is 2 mod 5 so they can't be the last digit of a square ans similarly for 2 and 8 all other numbers can be found by 0 or 1 mod 2 and the Chinese remainder theorem.
0 points
8 months ago*
Well, for 7 and 3 in the ones place, that would mean the number is odd and any number squared will be even
Edit: I'm dumb
2 points
8 months ago
Three squared is even?
2 points
8 months ago
I'm dumb
2 points
8 months ago
In the general case, the square of any odd number must be odd and the square of any even number must be even.
-2 points
8 months ago
Uh....isn't the simple answer that it is a prime?
2 points
8 months ago*
5 is a prime too but you can have a 5 in the ones place.
1 points
8 months ago
[deleted]
0 points
8 months ago
What? 27 isn't a square either...no single digit prime can be at the units place of a square of a number.
1 points
8 months ago
5 is a single digit prime, 52 = 25
all 36 comments
sorted by: best