给出卡迈克尔函数
.
CarmichaelLambda
给出卡迈克尔函数
.
更多信息
- CarmichaelLambda 也被称为简化欧拉函数或最小通用指数函数.
- CarmichaelLambda 通常在质数测试中使用,以查找无法通过某些质数测试证明为合数的合数.
- 整型数学函数,适合于符号和数值计算.
- CarmichaelLambda[n] 是最小的正整数
,使得对于所有
而言,
与
互质. - 对于数字
,其中,
为单位值,
为素数,CarmichaelLambda[n] 返回 LCM[(p1-1)
,…,(pm-1)
].
范例
打开所有单元 关闭所有单元基本范例 (2)
计算
的 CarmichaelLambda:
CarmichaelLambda[10]DiscretePlot[CarmichaelLambda[n], {n, 0, 50}]范围 (7)
数值运算 (4)
CarmichaelLambda[10]CarmichaelLambda[-10]CarmichaelLambda[10 ^ 90 + 1]CarmichaelLambda 遍历列表:
CarmichaelLambda[{2, 4, 7}]TraditionalForm 格式化:
CarmichaelLambda[n]//TraditionalForm符号运算 (3)
FindInstance[CarmichaelLambda[n] == EulerPhi[n] && n > 0, n, Integers]FullSimplify[Mod[a ^ CarmichaelLambda[n], n], Element[a | n, Integers] && GCD[a, n] == 1 && n > 1]识别 CarmichaelLambda 数列:
FindSequenceFunction[{1, 1, 2, 2, 4, 2, 6, 2, 6, 4}, n]应用 (7)
基本应用 (3)
CarmichaelLambda 的前 20 个值:
Grid[{Prepend[Range[20], "n"], Prepend[Table[CarmichaelLambda[n], {n, 20}], "TraditionalFormλ(n)"]}, Background -> {None, {Orange, StandardGray}}, Dividers -> Lighter[Gray, .5], Spacings -> {Automatic, .8}]DiscretePlot[CarmichaelLambda[n], {n, 0, 100}]NumberLinePlot[Table[CarmichaelLambda[n], {n, 100}]]CarmichaelGF[z_] := Sum[CarmichaelLambda[n] * z ^ n, {n, 500}]GraphicsRow[{Plot[CarmichaelGF[x], {x, 0, 1}], ContourPlot[Re[CarmichaelGF[x + I * y]], {x, -1, 1}, {y, -1, 1}, ContourStyle -> None]}]CarmichaelEGF[z_] := Sum[CarmichaelLambda[n] * z ^ n / n!, {n, 500}]GraphicsRow[{Plot[CarmichaelEGF[x], {x, 0, 5}], ContourPlot[Re[CarmichaelEGF[x + I * y]], {x, -3, 3}, {y, -3, 3}, ContourStyle -> None]}]CarmichaelDirichlet[s_] := Sum[CarmichaelLambda[n] / n ^ s, {n, 500}]GraphicsRow[{Plot[CarmichaelDirichlet[x], {x, 0, 1}], ContourPlot[Re[CarmichaelDirichlet[x + I * y]], {x, -1, 1}, {y, -1, 1}, ContourStyle -> None]}]素性测试 (2)
Table[Mod[a ^ (11 - 1), 11] == 1, {a, 1, 10}]primeQ[n_, a_ : 2] := Mod[a ^ (n - 1), n] == 1{primeQ[3], primeQ[9], primeQ[23]}{primeQ[341, 2], primeQ[341, 3]}Mod[561, CarmichaelLambda[561]]primeQ[561, 2]AllTrue[Select[Range[561], CoprimeQ[#, 561]&], primeQ[561, #]&]识别卡迈克尔数,使得对于所有与 n 互质的 a,有 an≡1 mod n 成立的合数:
CarmichaelNumberQ[n_] := CompositeQ[n] && Mod[n, CarmichaelLambda[n]] == 1CarmichaelNumberQ[561]CarmichaelNumberQ[1310]密码学 (1)
{p, q} = Prime[RandomInteger[{10 ^ 4, 10 ^ 5}, {2}]];
n = p qλ = CarmichaelLambda[n]d = NestWhile[#1 + 1&, Round[n / 3], GCD[λ, #1] =!= 1&]e = ModularInverse[d, λ]PowerMod[ToCharacterCode["RSA in Mathematica"], e, n]FromCharacterCode[PowerMod[%, d, n]]数论 (1)
FindCycles[n_] := Cases[GroupElements[CyclicGroup[EulerPhi[n]]], Cycles[{x_}] -> x]EulerPhi[12]subgroups = FindCycles[14]Dimensions[subgroups][[2]]CarmichaelLambda[12]属性和关系 (7)
CarmichaelLambda[{-2, -1, 0, 1, 2}]{Divisible[24, 8], Divisible[CarmichaelLambda[24], CarmichaelLambda[8]]}CarmichaelLambda 的 LCM 等于 LCM 的 CarmichaelLambda:
{LCM@@CarmichaelLambda[{3, 8}], CarmichaelLambda[LCM[3, 8]]}SquareFreeQ[17]Mod[3 ^ (CarmichaelLambda[17] + 1), 17]元素模除
的乘法阶数整除 CarmichaelLambda[n]:
Divisible[CarmichaelLambda[9], MultiplicativeOrder[4, 9]]Divisible[EulerPhi[8], CarmichaelLambda[8]]如果
具有原根,则 CarmichaelLambda 和 EulerPhi 相同:
Cases[Range[2, 20], n_ /; IntegerQ[PrimitiveRoot[n]]]CarmichaelLambda[%]EulerPhi[%%]巧妙范例 (2)
不同的 CarmichaelLambda 值的图形:
ArrayPlot[Table[CarmichaelLambda[j + 5k], {j, 1, 100}, {k, 1, 100}], ColorFunction -> "AvocadoColors"]乌岚螺旋,根据 CarmichaelLambda 的值对数字进行着色:
ulam[n_] := Partition[Permute[Range[n ^ 2], Accumulate[Take[Flatten[{{n ^ 2 + 1} / 2, Table
[(-1) ^ j i, {j, n}, {i, {-1, n}}, {j}]}], n ^ 2]]], n]ArrayPlot[CarmichaelLambda[ulam[101]], ColorFunction -> "Rainbow"]技术笔记
历史
1999年引入 (4.0) | 在以下年份被更新:2018 (11.3)
文本
Wolfram Research (1999),CarmichaelLambda,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CarmichaelLambda.html (更新于 2018 年).
CMS
Wolfram 语言. 1999. "CarmichaelLambda." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2018. https://reference.wolfram.com/language/ref/CarmichaelLambda.html.
APA
Wolfram 语言. (1999). CarmichaelLambda. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CarmichaelLambda.html 年
BibTeX
@misc{reference.wolfram_2026_carmichaellambda, author="Wolfram Research", title="{CarmichaelLambda}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/CarmichaelLambda.html}", note=[Accessed: 10-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_carmichaellambda, organization={Wolfram Research}, title={CarmichaelLambda}, year={2018}, url={https://reference.wolfram.com/language/ref/CarmichaelLambda.html}, note=[Accessed: 10-September-2026]}