Talk:Puzzles/Arithmetical puzzles/Digits of the Square

9376 - Thomas with a little help of the computer ;). I wonder: is there a trick to do this by hand?

Well, you certainly don't have to try all 9000 possibilities. Hint: 9376 = 9000 + 376. Also (x + y)&sup2; = x(x + 2y) + y&sup2;. Incidentally numbers of this type fall into a rather regular pattern which will require no guess-and-check at all. But you'd probably have to already have some of them to see the pattern. Eric119 04:23, 12 Oct 2003 (UTC)

I don't think you can do this rigourously and algebraically, it involves finding a solution to $$a=(a^2/10^4 - \lfloor a^2/10^4\rfloor )10^4$$ for a &isin; [1000,9999] Dysprosia 04:27, 12 Oct 2003 (UTC)

Thinking a bit more about the problem, I am now pretty sure that it can be solved analytically and by hand:

We can start by writing the equation given by Dysposia:

$$a=a^2 - \lfloor a^2/10^4 \rfloor 10^4$$

which is equivalent to:

$$a^2-a=\lfloor a^2/10^4\rfloor 10^4$$

this implies:

$$a(a-1) \equiv 0 (mod 10^4)$$

or

$$a(a-1) = k 10^4 (for k \in Z)$$

We can decompose $$10^4 = 2^4 * 5^4 $$. Also, it is relatively easy to see that either a must provide all the 2's and a-1 all the 5's or vice versa (because it can't be that both a and a-1 are divisible by 2, or that both a and a-1 are divisible by 5).

Case 1: If a contained all the 5's then it must be divisible by 625. We now want that:

$$ a-1 \equiv 0 (mod 16)$$

which is equivalent to:

$$ a \equiv 1 (mod 16)$$

It turns out that a=625 has $$ a \equiv 1 (mod 16)$$ (625 = 39*16+1). Unfortunately a is too small. The other possible multiples of 625 (2*625, 3*625,...,15*625) then give (by laws for modulo operations) $$ a \equiv 2,3,...,15 (mod 16)$$ none of which satisfies $$ a \equiv 1 (mod 16)$$. So this case leads to a dead end

Case 2: If a contained all the 2's then a-1 must be divisible by 625. We now want that:

$$ a \equiv 0 (mod 16)$$

which is equivalent to:

$$ a-1 \equiv 15 (mod 16)$$

Now if we run through all the multiples of 625 we find a suitable one (and only this one): a-1=15*625=9375 which means that our desired number is a=9376. Thomas


 * Kudos! A nice solution; I would never have seen it :) Dysprosia 08:24, 12 Oct 2003 (UTC)


 * Wow. I am impressed. Broadening the scope of discussion, I have been thinking about numbers like these for some months now (though sporadically). In base 10, the sequence is infinite:


 * 1
 * 5
 * 6
 * 25
 * 76
 * 376
 * 625
 * 9376
 * 90625
 * 890625
 * 109376
 * 2890625
 * 7109376
 * 12890625
 * 87109376
 * 212890625
 * 787109376
 * 1787109376
 * 8212890625
 * and so on


 * Note that there are two sequences, one with numbers ending in 5 and the other with numbers ending in 6. The occurence of 1 is a singularity. (I first proved this so I could justify not putting it into my program to find these :-). The 5, 25, 625, 90635... sequence and the 6, 76, 376, 9376... sequence fall into simple patterns that I did not notice until I had proved what they were. The patterns also generalize to bases 4x+2, x in Z and > 0.


 * I post all this at the risk of having you prove everything I've asserted within an hour and a lot faster than I did. :) But, hey, it might be worthwhile to compare different proofs. Eric119 20:01, 12 Oct 2003 (UTC)