Jump to content

Babbage problem: Difference between revisions

m
RE
No edit summary
m (RE)
Line 402:
<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}}==
<lang ring>
2,300

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.