by kirillcool · 5y ago · 0 comments
n^4 % x = m
== (n % x)^4 % x = m
By way of demonstration: n = 18, x = 15
18^4 = 104976 = 6 (mod 15)
----
18 % 15 = 3
3^4 = 81 = 6 (mod 15)
A very handy result to remember for cases where you don't want to use or don't have easy access to arbitrary precision integers.EDIT: Pasting into Lynx screwed formatting from Groff.