Carmichael Number Checker

Check the composite, square-free, and p−1-divides-n−1 conditions of Korselt’s criterion for a Carmichael number; trial division is limited to n≤10¹².

Description

Carmichael numbers are composite numbers that pass Fermat congruences for every coprime base.

Carmichael numbers are composite numbers that pass Fermat congruences for every coprime base. Korselt’s criterion tests this property from a square-free prime factorization.1

The tool returns isCarmichael. The indexing and output conventions below determine how to read these values.

When to use Carmichael Number Checker

Use this for the following task: Check the composite, square-free, and p−1-divides-n−1 conditions of Korselt’s criterion for a Carmichael number; trial division is limited to n≤10¹². Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use Carmichael Number Checker and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter n according to the field table, then run the tool.
  3. Read isCarmichael. A true flag means the candidate meets the stated property; false means it does not.
  4. If the flag is false, review the candidate and definition. A well-formed nonmember is different from a rejected input.
Input fieldMeaningValue type and boundsRequirement
nPositive integer (trial-division resource limit 10^12)integer; minimum 1; maximum 1000000000000Required

Factor n and require more than one distinct prime, every exponent equal to one, and exact BigInt divisibility of n−1 by each p−1.

Carmichael ⇔ composite and square-free, with (p−1)|(n−1) for every p|n

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
isCarmichaelWhether n is a Carmichael numberboolean
json
{
  "input": {
    "n": 561
  },
  "output": {
    "isCarmichael": true
  }
}

Limitations and assumptions

The candidate is at most 10¹². This checks the Carmichael-number predicate, not the Carmichael lambda function, and does not imply cryptographic suitability.

Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.

Alternative or Complementary methods

Choose Base-Two Fermat Pseudoprime Checker when you need its operation: Check whether n is composite and 2^(n−1)≡1 (mod n), using exact modular arithmetic and trial primality testing limited to n≤10¹². Choose Carmichael Lambda Function for the complementary operation: Return the exponent of the multiplicative group modulo n exactly from prime powers and their lcm, with λ(1)=1 and trial division limited to n≤10¹².

Background reference: OEIS A002997.

References

  1. OEIS A002997 — OEIS Foundation

Similar or alternative tools

  • Base-Two Fermat Pseudoprime Checker

    Check whether n is composite and 2^(n−1)≡1 (mod n), using exact modular arithmetic and trial primality testing limited to n≤10¹².

  • Carmichael Lambda Function

    Return the exponent of the multiplicative group modulo n exactly from prime powers and their lcm, with λ(1)=1 and trial division limited to n≤10¹².

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies