You are viewing a single comment's thread. Return to all comments →
In deriving tan(n * alpha) we can use tangent identity recursively until it reaches tan(alpha).
tan(alpha + beta) = [tan(alpha) + tan(beta)] / [1 - tan(alpha) * tan(beta)]
The right hand side expanded recursively overflows. To avoid overflow we can ues modular division.
(a / b) mod n = [(a mod n)(b^(−1) mod n)] mod n when the right hand side is defined (that is when b and n are coprime).
To find modular multiplicative inverse of b modulo n, i.e. x below,
bx ≡ 1 mod n or bx + ny = gcd(b, n) = 1
use Extended Eucleadean Algorithm that finds quotients x and y in addition to gcd(b, n).
Seems like cookies are disabled on this browser, please enable them to open this website
Simple One
You are viewing a single comment's thread. Return to all comments →
In deriving tan(n * alpha) we can use tangent identity recursively until it reaches tan(alpha).
The right hand side expanded recursively overflows. To avoid overflow we can ues modular division.
To find modular multiplicative inverse of b modulo n, i.e. x below,
use Extended Eucleadean Algorithm that finds quotients x and y in addition to gcd(b, n).