10 CLS 20 CALL modularinverse(42, 2017) 30 CALL modularinverse(40, 1) 40 END 50 SUB modularinverse(e,t) 60 d = 0 70 IF e < t THEN 80 b = e 90 c = 1 100 WHILE b > 1 110 s = INT(((t-b)/e)+1) 120 b = b+s*e 130 c = c+s 140 b = b-t 150 WEND 160 d = c 170 ENDIF 180 m = d 190 PRINT m 200 END SUB