Skip to content

feat: Add Sieve of Eratosthenes algorithm in new Math category#11

Open
dcq-31 wants to merge 1 commit intomidudev:mainfrom
dcq-31:feat/add-sieve-of-eratosthenes
Open

feat: Add Sieve of Eratosthenes algorithm in new Math category#11
dcq-31 wants to merge 1 commit intomidudev:mainfrom
dcq-31:feat/add-sieve-of-eratosthenes

Conversation

@dcq-31
Copy link
Copy Markdown

@dcq-31 dcq-31 commented May 4, 2026

Add Sieve of Eratosthenes algorithm in new Math category

Summary

Adds the Sieve of Eratosthenes — the classical O(n log log n) prime-finding algorithm — under a new Math / Matemáticas category. Visualized as a 5×6 grid for numbers 1–30, with composites and primes shown in distinct colors at the end so the result is easy to read.

Changes

  • New algorithm: src/lib/algorithms/math.ts with sieveOfEratosthenes (matrix visualization, bilingual steps).
  • Registry: Imports the algorithm and registers the Math category in src/lib/algorithms/index.ts.
  • i18n: Adds Math / Matemáticas labels and full English + Spanish descriptions in src/i18n/translations.ts.
  • Sidebar: Adds a π-glyph icon and fuchsia color theme for the Math category.
  • ComplexityChart: Adds O(n log log n) to the canonical complexity set.

Visualization

Numbers 1–30 laid out in a 5×6 grid. Animation steps:

  1. Highlight current prime i.
  2. Cross out each multiple j = i², i² + i, … (yellow → green as it becomes composite).
  3. Final frame: composites green, primes purple for clear contrast.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

@dcq-31 is attempting to deploy a commit to the midudev pro Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant