Babbage problem: Difference between revisions
Content added Content deleted
No edit summary |
Walterpachl (talk | contribs) m (RE) |
||
Line 402: | Line 402: | ||
<br><br> |
<br><br> |
||
===start with smallest possible number=== |
|||
<lang rexx>/*REXX ---------------------------------------------------------------- |
|||
* The solution must actually be larger than sqrt(269696)=519.585 |
|||
*--------------------------------------------------------------------*/ |
|||
z=0 |
|||
Do i=524 By 10 Until z>0 |
|||
If right(i*i,6)==269696 then z=i |
|||
Else Do |
|||
j=i+2 |
|||
if right(j*j,6)==269696 then z=j |
|||
End |
|||
End |
|||
Say "The smallest integer whose square ends in 269696 is:" z |
|||
Say ' 'z'**2 =' z**2</lang> |
|||
{{out}} |
|||
<pre>The smallest integer whose square ends in 269696 is: 25264 |
|||
25264**2 = 638269696</pre> |
|||
=={{header|Ring}}== |
=={{header|Ring}}== |
||
<lang ring> |
<lang ring> |