The task
Your code should take in an integer 0 < x < 154524170117757878519510473095631593888409463098071965593254291461501637330902918203684832716283083
and output the smallest integer m
such that x^m mod 154524170117757878519510473095631593888409463098071965593254291461501637330902918203684832716283083 = 1
. This long number is the next prime after 2^100
so can be encoded efficiently.
You may take the input in any format that is convenient and output in any convenient form too.
Your code should take less then one minute to run on a standard desktop no matter what the input.
Examples
2, 77262085058878939259755236547815796944204731549034235851503548771316711413838489497242205033676
77262085058878939259755236547815796944204731549033, 1545241701177578785195104730956315938884094630980616943406014195085266845655353957988968820134704
15452417011775787851951047309563159388840946309806169434060141950852668456553539579889688, 216943406014195085266845655353957988968820134704
Those with python or similar can check the answers with e.g. pow(3,16943406014195085266845655353957988968820134704, 1965593254291461501637330902918203684832716283083)
which equals 1
.
You may not use any builtin or library function which solves this problem for you.