let e = 42 let t = 2017 gosub modularinverse end sub modularinverse let d = 0 if e < t then let b = e let c = 1 do let s = int(((t - b) / e) + 1) let b = b + s * e let c = c + s let b = b - t loop b <> 1 let d = c endif let m = d print m return