Carmichael Function Calculator
Enter a positive integer n to compute λ(n) and φ(n).
Result
How it is calculated
The tool factorises n by trial division, then works prime power by prime power.
For each pk in the factorisation: φ(pk) = pk−1(p − 1). The Carmichael value of that factor is the same, λ(pk) = φ(pk), with one exception: for powers of two with k ≥ 3, λ(2k) = 2k−2.
Then λ(n) = lcm of all the λ(pk), while φ(n) = product of all the φ(pk). n must be a whole number from 1 to 1,000,000,000; zero, negatives, decimals and larger numbers give no result. λ(1) and φ(1) are both 1. The result is always a divisor of φ(n).
Worked example
Take n = 561 = 3 × 11 × 17. Each prime appears once, so φ(3) = 2, φ(11) = 10, φ(17) = 16. Euler's φ(561) is their product: 2 × 10 × 16 = 320. The Carmichael function takes the least common multiple instead: lcm(2, 10, 16) = 80. So λ(561) = 80, a quarter of φ(561), and a^80 ≡ 1 (mod 561) for every a coprime to 561.
Common mistakes
- Assuming λ(n) equals φ(n). They agree for primes and for 2, 4 and odd prime powers, but for composite n with several prime factors λ(n) is usually smaller (λ(15) = 4, φ(15) = 8).
- Forgetting the special rule for powers of two. λ(8) is 2, not 4, and λ(16) is 4, not 8.
- Multiplying the factor values together when computing λ. It is the least common multiple that is used; the product gives φ.
- Entering a number beyond one billion or a decimal such as 2.5. The tool accepts only whole numbers up to 1,000,000,000.
- Believing λ(n) is the smallest exponent for one chosen base a. It is the smallest exponent that works for every a coprime to n; a particular a may have a smaller order.
About this calculator
The Carmichael function λ(n), sometimes called the reduced totient, gives the smallest positive integer m such that a^m ≡ 1 (mod n) for every integer a that is coprime to n. It plays a similar role to Euler's totient φ(n) — which counts how many integers below n are coprime to n — but λ(n) is often smaller because it finds the true smallest universal exponent rather than just any exponent that happens to work; in fact λ(n) always divides φ(n).
This function matters in modular arithmetic and cryptography: RSA key generation can use λ(n) in place of φ(n) when deriving the private exponent, and because λ(n) is frequently smaller than φ(n), it can produce a smaller valid exponent for the same modulus, which is the basis of the Carmichael-based variant of the RSA key-generation formula. Number theorists also study λ(n) when analyzing the structure of the multiplicative group of integers modulo n and its cyclic subgroup decomposition.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments