Skip to content

Instantly share code, notes, and snippets.

@vinloo
Last active May 6, 2019 14:42
Show Gist options
  • Select an option

  • Save vinloo/ee07895eea5ec879ca0c42b1b987db6a to your computer and use it in GitHub Desktop.

Select an option

Save vinloo/ee07895eea5ec879ca0c42b1b987db6a to your computer and use it in GitHub Desktop.
Find inverse of a number in a range of integers
ClrHome
Disp "Inverse of a in Z(n)"
Input "a = ",A
Input "n = ",N
remainder(A,N)→B
For(I,1,N)
If remainder((B*I),N)=1
Then
Disp I
Stop
End
End
Disp ""
Disp "No solution!"
Stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment