**1. Pell matrix powers**

1. Set T = [[2,1],[1,0]].

2. Compute Tᴺ by repeated squaring, or by the recurrence P(n) = 2P(n−1) + P(n−2) with P₀ = 0, P₁ = 1.

3. Read off Tᴺ = [[P(N+1), P(N)], [P(N), P(N−1)]] and Tr Tᴺ = Q(N).

4. Check Q² − 8P² = 4(−1)ᴺ.


**2. Scattering through an N-site chain**

1. Fix the chain (ε = 0, t_R = 1, t_L = −1, E = 2) and leads (J = 1, on-site energy 1), so k = π/3.

2. Compute Tᴺ.

3. Write wave continuity at both interfaces, including the t_L = 1 → −1 hopping jump.

4. Solve the linear system for t and r, or use the closed form with Δ = P(N−1)A² + 2J·P(N)·A + J²·P(N+1), A = e^{ik}.

5. Check that |t|² falls by about δ⁻² per added site.


**3. PT-dimer exceptional-point threshold**

1. Place defects with on-site energies 2√2 ± iγ, separated by N barrier sites.

2. Eliminate the barrier using Tᴺ.

3. Evaluate the eigenvalue condition at E = 2: F = (−1)ᴺ·2√2·δ^−(N+1) + γ²·P(N+1).

4. For odd N, solve F = 0 to get γ_c = √(1 − δ^−2(N+1)) / P(N+1).

5. For even N, report no real-γ threshold.


**4. Numerical threshold search (verification)**

1. Build a finite chain with long outer barriers, anti-Hermitian hoppings, and the two complex defects.

2. Diagonalize for a given γ.

3. Keep eigenvalues near E = 2.

4. Bisect on γ until those eigenvalues first acquire a nonzero imaginary part.

5. Compare with the formula in procedure 3.


**5. Asymptotic eigenvalue by Rayleigh quotient**

1. Start from any nonzero vector (Pₙ, Pₙ₋₁).

2. Apply T repeatedly.

3. At each step compute ⟨ψ|T|ψ⟩ / ⟨ψ|ψ⟩.

4. The value converges to δ.


**6. Generic recurrence analyzer**

1. Take the recurrence coefficients.

2. Build the companion matrix and the state vector.

3. Compute eigenvalues and eigenvectors.

4. Write the closed form as a sum of eigenvalue powers (Binet form).

5. Report the dominant eigenvalue as the asymptotic growth ratio.


**7. Hyperbolic continuation of a rotation**

1. Start with exp(iθ n·σ) = cos θ + i sin θ (n·σ).

2. Substitute θ → −iη.

3. Obtain cosh η + sinh η (n·σ).

4. Set η = ln δ, giving cosh η = √2 and sinh η = 1.

5. Check that the result has determinant 1 and eigenvalues δ^(±1).


**8. Mod-9 Lucas–Fibonacci checksum**

1. Choose the position in the 24-step cycle for the current state.

2. Compute the expected value of L_n² − 5F_n² mod 9, or the corresponding Pell/Fibonacci residue.

3. Compare it with the value computed from the actual state.

4. Flag a mismatch as corruption. A random error passes with probability about 1/9.


**9. Pell-matrix integrity check**

1. Encode (x, y) as [[x, dy], [y, x]].

2. Compute the determinant x² − dy².

3. Compare with the expected value (1 for solutions of the Pell equation).

4. A different determinant signals corruption.


**10. Cut-and-project (quasicrystal generation)**

1. Choose a lattice Λ, an orthogonal split E∥ ⊕ E⊥, and a compact window W in E⊥.

2. For each lattice point γ, project onto E⊥.

3. If the projection falls in W, keep the projection onto E∥.

4. The kept points form the quasicrystal.


**11. Klein bottle embedding in ℝ⁴**

1. Pick a > b > 0.

2. Evaluate the four coordinate functions over (u, v).

3. Drop the fourth coordinate to get the self-intersecting 3D immersion.

4. Check the identification: u → u + 2π must map (z, t) → −(z, t), equivalent to v → −v.


**12. Correlation-length benchmark (tensor network)**

1. Use T as the transfer operator.

2. Compute its two eigenvalues, δ and −1/δ.

3. Take the ratio of magnitudes, δ⁻².

4. Set the correlation length to ξ = 1/(2 ln δ).

5. Use this as the reference value for MPS code tests.