Content deleted Content added
No edit summary |
use math template |
||
Line 3:
|formula=ifgreaterorequal(curstep,{{#expr:{{{n}}}*2}},1,0)
|starthidden=1
|1={{#ifeq:{{{n}}}|0||<hr>}}{{math|1={{calculator
|formula=r{{{n}}}
|type=plain
Line 11:
|type=plain|
style=background-color: hsl( calc( var( --calculator-colorstep{{#expr:{{{n}}}*2}},0) * 0.39215 + 55), 100%, 70%, calc( var( --calculator-colorstep{{#expr:{{{n}}}*2}},0) + var(--calculator-colorstep{{#expr:{{{n}}}*2+2}})))
}} + r<sub>{{{n}}}}}</sub><br>
}}
{{Calculator-hideifzero
|formula=ifgreaterorequal(curstep,{{#expr:{{{n}}}*2+1}},1,0)
|starthidden=1
|1={{math|1=q<sub>{{{n}}}</sub> = {{calculator
|formula=floor(r{{{n}}}/r{{#expr:{{{n}}}+1}})
|id=q{{#expr:{{{n}}}+2}}|type=plain
Line 24:
|type=plain
|style=background-color: hsl(155,100%,70%,var(--calculator-colorstep{{#expr:{{{n}}}*2+2}}))
}}}}{{calculator-hideifzero
|formula=not(r{{#expr:{{{n}}}+2}})
|starthidden=1
|1=<br>Since {{math|r<sub>{{{n}}}</sub>=0}} the algorithm is finished. Thus '''GCD( {{calculator|formula=x|type=plain}}, {{calculator|formula=y|type=plain}} ) = {{calculator|formula=ifequal(r{{#expr:{{{n}}}+1}},0,r0,r{{#expr:{{{n}}}+1}})|type=plain}}'''.
}}
}}{{calculator
|