Prog modular arithmetics --- Introduction ---

This modules gathers interactive programming exercises, variable and configurable, on the subject of modular arithmetics. The software can ask you to produce an algorithm to compute addition, multiplication, power, polynomial, division etc. in NZZ, where N is a prime. It will then compile your submitted code and test it on randomly generated integers for the validity of the code.

01 - Addition

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


03 - Linear combination

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


11 - Division

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


10 - Inverse

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


02 - Multiplication

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


05 - Small polynomial

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


07 - General polynomial

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


04 - Power I

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


06 - Power II

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


08 - Power III

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:


09 - Power IV

a function which takes an integer , integers , and returns the class of

in represented by an integer between 0 and . ()


ERROR. Your code didn't give anything. Syntax error?
Your code didn't pass the test on the case :

It returns , while the right result should be .

Please correct (try number , limited to ).


ATTENTION! The length of your code is limited to characters not including spaces. And the score depends on the length. The shorter is the code, the higher is the score, up to a complete score if the length does not exceed .

The following names ARE NOT allowed in the code:

The most recent version


Cette page n'est pas dans son apparence habituelle parce que WIMS n'a pas pu reconnaître votre navigateur web.
Afin de tester le navigateur que vous utilisez, veuillez taper le mot wims ici : puis appuyez sur ``Entrer''.

Veuillez noter que les pages WIMS sont générées interactivement; elles ne sont pas des fichiers HTML ordinaires. Elles doivent être utilisées interactivement EN LIGNE. Il est inutile pour vous de les ramasser par un programme robot.