沃尔夫拉姆数学。如何隐藏一个当权者
Wolfram Mathematica. How to hide one in power
我有密码
(# /. {x_, y_} -> Defer[x^y]) & /@ FactorInteger[x]
这给了我一个例子
{63, {3<sup>2</sup>, 7<sup>1</sup>}}
如何将 7^1 替换为简单的 7
取号:
number = 2^3 3^7 5^2 7^1
3061800
那我觉得这样好一点
Replace[FactorInteger[number], {{x_, 1} -> x, {x_, y_} -> Defer[x^y]}, {1}]
如果您使用 ReplaceAll
又名 /.
,您实际上并不需要 Map
又名 /@
以后去:
我有密码
(# /. {x_, y_} -> Defer[x^y]) & /@ FactorInteger[x]
这给了我一个例子
{63, {3<sup>2</sup>, 7<sup>1</sup>}}
如何将 7^1 替换为简单的 7
取号:
number = 2^3 3^7 5^2 7^1
3061800
那我觉得这样好一点
Replace[FactorInteger[number], {{x_, 1} -> x, {x_, y_} -> Defer[x^y]}, {1}]
如果您使用 ReplaceAll
又名 /.
Map
又名 /@
以后去: