264
Views
1
CrossRef citations to date
0
Altmetric
Classroom Notes

The power of the snake: number theory with Python

Pages 3484-3490 | Received 18 Jun 2021, Published online: 29 Nov 2021
 

Abstract

The Python programming language is a powerful tool in teaching Number Theory and other pure mathematics classes. Python can be used to make the content more interactive and applicable. I am illustrating this with a few code snippets that I have used in my Number Theory and Cryptography classes.

2020 Mathematics Subject Classification:

Disclosure statement

No potential conflict of interest was reported by the author.

Notes

1 Computer scientists like to start counting with zero. Python follows this philosophy.

2 Users of Python 3.8 or higher can use from math import prod instead.

3 For sake of brevity, we skipped checking that the lists a and m have the same length and that the moduli are pairwise coprime.

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.