Ramanujan's Notebooks, shared: thetaPsi
DefinitionRamanujanNotebooks_shared_thetaPsinumber-theoryramanujan-notebooks
Ramanujan's ψ(q) = f(q, q^3) = ∑_{k ≥ 0} q^{k(k+1)/2} (Entry 22(ii), Part III, p. 36).
Domain: ‖q‖ < 1. There ψ(q) = (q^2; q^2)_∞ / (q; q^2)_∞. Outside: 0.
Reference: 1 + q + q^3 + q^6 + q^10 + …, ψ(1/5) = 1.2080641024327700971….
Definition code
import Mathlib
noncomputable section
namespace RamanujanNotebooks
/-- Ramanujan's `ψ(q) = f(q, q^3) = ∑_{k ≥ 0} q^{k(k+1)/2}` (Entry 22(ii), Part III, p. 36).
Domain: `‖q‖ < 1`. There `ψ(q) = (q^2; q^2)_∞ / (q; q^2)_∞`. Outside: `0`.
Reference: `1 + q + q^3 + q^6 + q^10 + …`, `ψ(1/5) = 1.2080641024327700971…`. -/
def thetaPsi (q : ℂ) : ℂ :=
∑' n : ℕ, q ^ (n * (n + 1) / 2)
end RamanujanNotebooks
end
Source
Bruce C. Berndt, Ramanujan's Notebooks.