Modular Exponentiation 2 by yshl

[/m 46340/d{dup m mod exch m idiv}/*{d 3 2 roll d 3 index 2 index mul d 5 index
3 index mul add d exch 5 index 5 index mul add d 3 2 roll add 5 index 4 index
mul add c mod 2{/k 1 index c m idiv idiv def c m idiv k mul sub m mul exch c m
mod k mul sub add c mod dup 0 lt{c add}if}repeat 5 1 roll def
def}>>begin[.runstdin]{count 3 eq{/c exch def exch 1 31{2 index 1 and 1 eq{1
index *}if exch dup * exch 3 2 roll 2 idiv 3 1 roll}repeat = def}if}forall

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page