Skip to content

Conversation

@Manas-7854
Copy link

New Algorithm Module

algorithms/exp_squaring.typ

  • Formal recursive definition of exponentiation by squaring with base cases for even/odd exponents.

  • Mapcode-style specification (ρ, F, π) following the memoization pattern:

    - I = (b, n) : ℕ × ℕ₀ — Input space of base-exponent pairs
    - X_(b,n) = [0..n] → ℕ_⊥ — State space tracking computed powers
    - F(x_k) — Recursive computation using x_⌊k/2⌋² for even indices and b · x_⌊k/2⌋² for odd
    - π(x) = x_n — Extraction function returning the final result
    
  • Concrete computation example for 3^ 5=243

  • 3^ 5=243 showing the memoization table evolution.

Full visualization using the mapcode-viz framework with:

Yellow highlighting for newly computed values
Step-by-step tensor updates from initial ⊥ state to final result
Proper handling of the recursive dependency structure

@Manas-7854 Manas-7854 changed the title added exp_squaring Added Exponential and Digit Reversal Nov 15, 2025
@Manas-7854 Manas-7854 changed the title Added Exponential and Digit Reversal Added Exponential Squaring Nov 15, 2025
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