well I started with N="abbbb"=10^4*a+1111b so we want N^2-1 to be a 10 digit number consisting of all the digits 0-9 once each. For N^2-1 to be a 10 digit number it is easy to see that a>=3. Now also, since N^2-1 is all the digits 0-9 then its digit sum is 45 and thus N^2-1 is divisible by 9 and thus N^2 is congruent to 1 modulo 9. Now substituting N=10^4*a+1111b in N^2-1, expanding, and then simplfying modulo 9 we end up with a^2+8ab+7b^2=(a+b)(a+7b) now this must be congruent 1 modulo 9. Now let a+b mod 9=x and a+7b mod 9=y, the only possibilities for (x,y) that result in xy mod 9=1 is (1,1),(2,5),(5,2),(4,7),(7,4),(8,8) this gives the only possible values for x as 1,2,4,5,7,8. Now since x is the sum of 2 base 10 digits then x is either x, or x+9, thus the possibilities for a+b are 1,2,4,5,7,8,10,11,13,14,16,17. Now considering that a>=3 we can eliminate 1,2,4. So that leaves us with 5,7,8,10,11,13,14,16,17 and that gives us 32 possibilities for (a,b) working thru all of these possibilities by hand I end up with the only solutions being 85555 and 97777 which correspond to 7319658024 and 9560341728.
Posted by Daniel
on 2008-08-16 15:29:36