In the line of
1233 = 12² + 33²
990100 = 990² + 100²
can you find an eight digit number with the same property? Even longer numbers?
I used the following code in Mathematica to find all solutions with n digits
*begin code*
n:=8;
Reduce[{x*(10^n)+y==x^2+y^2,x>=10^(n-1),y>=10^(n-1),
x<10^n,y<10^n},{x,y},Integers]
*end code*
n holds the number of digits each half should be
The reduce function in Mathematica for those unfamiliar is very handy indeed. It allows you to give a series of conditions in the first part (which can have several variables), then list the variables to be solved for in the second part. Now the third part is what makes reduce so powerfull. The third part allows you to restrict your answers to a certain domain i.e Reals, Complex, or Integers. After all of these 3 parts are set reduce then attempts to reduce the conditions in order to give a general solution for the variables given. Another powerfull feature of reduce is that it can solve for the variables given in term of a number of constants. For example if you give it a diophantine equation it will find its general solution :-)
Now having said all of that, I decided to find some 20 digit numbers with this property
there are 12 solutions one of them being
8832116788 3211678833
*space used to show seperation of two values*
|
Posted by Daniel
on 2006-07-30 22:08:40 |