Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bumbii/code
Coding exercises in multiple programming languages (Python, Mojo...)
https://github.com/bumbii/code
Last synced: 3 months ago
JSON representation
Coding exercises in multiple programming languages (Python, Mojo...)
- Host: GitHub
- URL: https://github.com/bumbii/code
- Owner: bumbii
- Created: 2022-10-06T09:04:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T14:26:54.000Z (9 months ago)
- Last Synced: 2024-08-16T02:43:05.182Z (5 months ago)
- Language: Mojo
- Homepage: https://bumbii.tech
- Size: 41 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mojo-max-mlir - bumbii/code
- awesome-mojo-max-mlir - bumbii/code
README
## Coding exercises in Python and Mojo
$1.\quad S(n) = 1 + 2 + 3 + ...+ n.$ [Python](https://github.com/bumbii/code/blob/main/python/exercises/001/001.py) [Mojo](https://github.com/bumbii/code/blob/main/mojo/exercises/001/001.mojo)
---
$2.\quad S(n) = 1^2 + 2^2 + 3^2 + ... + n^2$ [Python](https://github.com/bumbii/code/blob/main/python/exercises/002/002.py) [Mojo](https://github.com/bumbii/code/blob/main/mojo/exercises/002/002.mojo)
---
$3.\quad S(n) = 1 + \frac{1}{2} + \frac{1}{3} + ... + \frac{1}{n}$ [Python](https://github.com/bumbii/code/blob/main/python/exercises/003/003.py) [Mojo](https://github.com/bumbii/code/blob/main/mojo/exercises/003/003.mojo)
---
$4.\quad S(n) = 1 + \frac{1}{4} + ... + \frac{1}{2n}$
---
$5.\quad S(n) = 1 + \frac{1}{3} + \frac{1}{5} + ... + \frac{1}{2n + 1}$
---
$6.\quad S(n) = \frac{1}{1 * 2} + \frac{1}{2 * 3} + ... + \frac{1}{n * (n + 1)}$
---
$7.\quad S(n) = \frac{1}{2} + \frac{2}{3} + \frac{3}{4} +... + \frac{n}{n + 1}$
---
$8.\quad S(n) = \frac{1}{2} + \frac{3}{4} + \frac{5}{6} +... + \frac{2n + 1}{2n + 2}$
---
$9.\quad T(n) = 1 * 2 * 3 * ... * n$
---
$10.\quad T(x, n) = x^n$
---
$11.\quad S(n) = 1 + 1 * 2 + 1 * 2 * 3 + ... + 1 * 2 * 3 * ... * n$
---
$12.\quad S(n) = x + x^2 + x^3 + ... + x^n$
---
$13.\quad S(n) = x^2 + x^4 + ... + x^{2n}$
---
$14.\quad S(n) = x + x ^ 3 + x^5 + ... + x^{2n + 1}$
---
$15.\quad S(n) = 1 + \frac{1}{1 + 2} + \frac{1}{1 + 2 + 3} + ... + \frac{1}{1 + 2 + 3 + ... + n}$
---
$16.\quad S(n) = x + \frac{x^2}{1 + 2} + \frac{x^3}{1 + 2 + 3} + ... + \frac{x^n}{1 + 2 + 3 + ... + n}$
---
$17.\quad S(n) = x + \frac{x^2}{2!} + \frac{x^3}{3!} + ... + \frac{x^n}{n!}$
---
$18.\quad S(n) = 1 + \frac{x^2}{2!} + \frac{x^4}{4!} + ... + \frac{x^{2n}}{(2n)!}$
---
$19.\quad S(n) = 1 + x + \frac{x^3}{3!} + \frac{x^5}{5!} + ... + \frac{x^{2n + 1}}{(2n + 1)!}$
---
$20.\quad \text{List all divisors of a positive integer \textcolor{green}{N}.}$
$\text{Example 1: input: N = 6, output: 1, 2, 3, 6}$
$\text{Example 2: input: N = 10, output: 1, 2, 5, 10}$
---
$21. \text{Given a positive integer \textcolor{green}{N}. Find the sum of all divisors of \textcolor{green}{N}.}$
$\text{Example: input: N = 6, output: 12}$
$\text{Explain:}$
$\text{The divisors of 6 are: 1, 2, 3, 6}$
$sum = 1 + 2 + 3 + 6 = 12$
## References
1. Programming Exercises (Vietnamese: Bài tập kỹ thuật lập trình) - Author: Nguyễn Tấn Trần Minh Khang (My teacher at University (University of Sciences, HCM City))
2. Python in highschool - Author: Arnaud Bodin
3. [How to write mathematical expressions on Github](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions)