diff options
author | n <@> | 2022-06-04 17:38:30 +0300 |
---|---|---|
committer | n <@> | 2022-06-04 17:38:30 +0300 |
commit | 168c6cd501a7d7ea7a6ec8441c0670dfb8d6f6a5 (patch) | |
tree | 606916d6bafe97880b80b1c0d4dbde561f302081 /l | |
parent | e6cae27c610a8f88a57f4798a3dd9fe74665562a (diff) |
maths.k extended gcd
Diffstat (limited to 'l')
-rw-r--r-- | l/maths.k | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -10,3 +10,4 @@ pri:{$[x<10;(x>)#o 10 /primes <x isp:{p:2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 /is x prime? $[x<62;~^p?x;+/~p!'x;0;&/(1=a)|/x=1+(s-1)q\a:(x!*)/((-1+#d)(q:x!*/2#,:)\2 7 61)@&d:(s:*&b)_b:|2\x-1]} mmu:(+/*)\: /matrix multiplication +inv:{y!*|*|(**:)({(y-x*(-*x)!*y;x)}.)/(y,0;x,1)} /multiplicative inverse of x modulo y (extended Euclidean algorithm) |