Task 5a: 16 bit modular inverse

0 submissions | 0/0 users solved | Full Leaderboard

Create a woodpecker script that takes 16-bit a and calculates the 16-bit modular inverse modulo 2**16 - 17 (65519) pow(a, -1, 2**16-17).

1<=a<65519 is guaranteed.

<low    a    hi> | <low  output hi>
-----------------------------------
1000000000000000 | 1000000000000000
0010000000000000 | 0011111111111100
1010001000000000 | 0000001110101101
0111011111111111 | 0111011111111111

Submit new Solution