Learn R Programming

Zseq (version 0.1.1)

Carmichael: Carmichael numbers

Description

Under OEIS A002997, a Carmichael number is a composite number \(n\) such that $$b^{n-1} = 1 (mod n)$$ for all integers \(b\) which are relatively prime to \(n\). First 6 Carmichael numbers are 561, 1105, 1729, 2465, 2821, 6601.

Usage

Carmichael(n, Rmpfr = TRUE, PrecisionBits = 496)

Arguments

n

the number of first n entries from the sequence.

Rmpfr

a logical; TRUE to use large number representation, FALSE otherwise.

PrecisionBits

a positive integer for precision bits larger than 2.

Value

a vector of length n containing first entries from the sequence.

Examples

Run this code
# NOT RUN {
## generate first 3 Carmichael numbers
first3 = Carmichael(3)

## print without trailing 0's.
print(first3, drop0trailing = TRUE)

# }

Run the code above in your browser using DataLab