# Quadratic Residue Solver AI Agent Connect

> Quadratic Residue Solver MCP provides a specialized mathematical engine for solving quadratic congruences. It handles odd primes, prime powers, and composite moduli through advanced number-theoretic methods. Your AI client can check for solvability, calculate all valid residue classes, inspect Hensel's Lemma steps, and verify results through direct substitution.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_zjP6THWenhk9XqsvA2DM1tmUc2x09EwUDmL3HErG/ai-agent-connect
- **Tags:** math, congruence, number-theory, algebra, residue

## Description

This MCP gives your AI client the mathematical heavy lifting needed for number theory problems. Instead of relying on the LLM to guess modular arithmetic results, you can hand off the computation to this specialized engine. It works across various moduli, including odd primes, prime powers, and composite numbers. 

You can use it to determine if a specific congruence even has a solution before you waste time searching for one. If you need to see the math behind the scenes, the tool provides a trace of the lifting process. It doesn't just give you a final answer; it provides the specific residue classes that satisfy the equation. Once the math is done, you can use the verification tool to double-check the results via direct substitution, ensuring the output is mathematically sound.

## Tools

### check_solvability
This tool determines if a solution exists for your specific congruence.

### get_lifting_trace
This tool provides a detailed mathematical breakdown of the lifting process used during calculation.

### solve_quadratic_congruence
This tool calculates all valid residue classes for x.

### verify_solutions
This tool validates the correctness of discovered solutions through direct substitution.

## Prompt Examples

**Prompt:** 
```
Is x^2 ≡ 2 (mod 7) solvable?
```

**Response:** 
```
No, 2 is a quadratic non-residue modulo 7.
```

**Prompt:** 
```
Solve x^2 ≡ 1 (mod 3).
```

**Response:** 
```
The solutions are 1 and 2.
```

**Prompt:** 
```
Find the solutions for x^2 ≡ 4 (mod 5).
```

**Response:** 
```
The solutions are 2 and 3.
```

## Capabilities

### Solvability Testing
Your agent uses this to check if a quadratic congruence has any valid solutions.

### Residue Class Calculation
The AI client uses this to find every value of x that satisfies the equation.

### Hensel's Lemma Inspection
Your agent can pull a trace to see the mathematical steps of the lifting process.

### Result Verification
The AI client performs direct substitution to confirm the accuracy of a solution.

### Composite Moduli Support
The engine handles calculations for prime powers and composite numbers.

## Use Cases

### Number Theory Research
Use the tool to quickly find residue classes for large prime moduli.

### Cryptographic Analysis
Check the solvability of congruences used in various encryption algorithms.

### Educational Verification
Students can use the lifting trace to check their manual work against the engine's steps.

### Algorithm Testing
Verify the correctness of custom mathematical scripts by comparing results with this MCP.

## Benefits

- Eliminates LLM hallucination in modular arithmetic calculations.
- Provides mathematical traces for Hensel's Lemma steps.
- Supports a wide range of moduli including prime powers and composite numbers.
- Allows for instant verification of solutions through substitution.

## How It Works

Connect the MCP to your client and start sending mathematical queries immediately.

1. Connect your preferred client like Claude or Cursor to Vinkius.
2. Input your quadratic congruence into your AI client.
3. The AI invokes the necessary tool to solve or check the equation.
4. The MCP returns the residue classes or the mathematical trace.
5. Your agent presents the verified result to you.

## Frequently Asked Questions

**What kind of moduli does this MCP support?**
The engine handles odd primes, prime powers, and composite moduli.

**Can I see the steps used to solve the congruence?**
Yes, you can use the get_lifting_trace tool to see the mathematical breakdown of the lifting process.

**How do I know if the solution is correct?**
You can use the verify_solutions tool to confirm the result through direct substitution.

**Does this work with Claude?**
Yes, this MCP works with any MCP-compatible client including Claude, Cursor, and Windsurf.

**Can it tell me if a solution exists before solving it?**
Yes, the check_solvability tool specifically determines if a solution exists for a given congruence.
