# E062: Carmichael λ(n) vs. φ(n) ```{figure} ../_static/experiments/e062_hero.png :width: 80% :alt: Preview figure for E062 ``` ```{figure} ../_static/experiments/e062_hero_2.png :width: 80% :alt: Preview figure for E062 ``` **Tags:** `number-theory`, `quantitative-exploration`, `visualization`, `arithmetic-functions`, `carmichael-lambda`, `totient` See: {doc}`../tags`. ## Highlights - Plot or histogram the ratio $\varphi(n)/\lambda(n)$. - Show how 2-adic structure affects λ(n) (notably for powers of 2). ## Goal See how the exponent of the multiplicative group mod n differs from its size. ## Background (quick refresher) - {doc}`../background/carmichael-lambda-function` - {doc}`../background/euler-totient-function` ## Research question How large can $\varphi(n)/\lambda(n)$ get for $n\le N$, and what kinds of n cause large gaps? ## Method - Compute φ(n) and λ(n) from prime-power formulas and lcm composition. - Visualize ratios (histograms, quantiles) and list top outliers. ## How to run - `make run EXP=e062` - `uv run python -m mathxlab.experiments.e062` ## Outputs This experiment follows the standard output contract: - `out/e062/figures/` — generated figures (PNG) - `out/e062/report.md` — short narrative report - `out/e062/manifest.json` — snapshot metadata for the gallery ## Published run snapshot If this experiment is included in the docs gallery, include the published snapshot (report + params). ```{include} ../reports/e062.md :start-after: "" :end-before: "" ``` ::: {dropdown} params.json (snapshot) :open: ```{literalinclude} ../params/e062.json :language: json ``` ::: ## References See {cite:t}`erdospomeranceschmutz1991carmichaelslambdafunction`, {cite:t}`montgomeryvaughan2006multiplicativenumbertheoryi`. ## Related experiments - {doc}`e100` (E100: Carmichael λ(n) vs. Euler φ(n)) - {doc}`e052` (Totient ratio landscape) - {doc}`e053` (Inverse totient multiplicities) - {doc}`e060` (Jordan totients) - {doc}`e099` (E099: Jordan totients J_k: identities and ratios)