Summary
Add a prime factorization endpoint at app/api/routes-f/prime-factorize/route.ts. Given a positive integer, return its prime factorization.
Requirements
- GET ?n=360 returns { n, factors: [{ prime, power }], factorization: '2^3 * 3^2 * 5', is_prime: bool }
- Validate n is a positive integer <= 2^53
- Use BigInt internally for large values
- Trial division with sqrt limit is fine
- Reject n < 2 with 400
- Tests cover primes, composites, perfect squares, large values
Scope Constraint - READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.
Summary
Add a prime factorization endpoint at app/api/routes-f/prime-factorize/route.ts. Given a positive integer, return its prime factorization.
Requirements
Scope Constraint - READ BEFORE STARTING
All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.