lilianjie 发表于 2012-1-11 17:58

一些初等算术逻缉函数

Z:=IntegerRing() ;
Z;
Z12:=IntegerRing(12);
Z12;
Z17:=IntegerRing(19);
Z17;
n:=Z!100;
n;
m:=Random(Z12);
m;

n div m;    求余
Z!n mod Z!m;
ExactQuotient(n, 5);求商
ShiftLeft(n, 1);乘2
ShiftLeft(n, 3);乘8
ShiftLeft(n, 10);乘1024
ShiftRight(n, 2);除4
ShiftRight(n, 3);除8
ShiftRight(n, 10);除1024
ModByPowerOf2(n, 2);模4
ModByPowerOf2(n, 3);模8
ModByPowerOf2(n, 5);模32IsEven(n) ;
IsOdd(n);
IsDivisibleBy(n, 13);
IsDivisibleBy(n, 2);
IsSquarefree(n) ;
IsPower(n);
IsPower(n, 10) ;
IsPower(n, 3) ;
IsSquare(n);
IsPrime(n) ;
IsIntegral(n);
IsSinglePrecision(n);单精度


Integer Ring
Residue class ring of integers modulo 12
Residue class ring of integers modulo 19
100
9
11
1
20
200
800
102400
25
12
0
0
4
4
true
false
false
true
false
true 10 2
false
false
true 10
false
true
true

lilianjie 发表于 2012-1-11 18:09

C<c>:=ComplexField(5);C;

n:=C!(11+22*c);
ComplexConjugate(n);
ComplexConjugate(n) ;复共轭
Conjugate(n) ;共轭
N:=Norm(n) ;N;范A:=AbsoluteValue(n);A;
Abs(n) ;
A^2 eq N;

Complex field of precision 5
11.000 - 22.000*c
11.000 - 22.000*c
11.000 - 22.000*c
605.00
24.597
24.597
true

lilianjie 发表于 2012-1-11 18:32

本帖最后由 lilianjie 于 2012-1-11 18:49 编辑

C:=RealField();C;

n:=C!1234/567;
ComplexConjugate(n);
ComplexConjugate(n) ;

N:=Norm(n) ;N;范
A:=AbsoluteValue(n);A;范
Abs(n) ;
A eq N;
Ilog2(n);
Truncate(n);取整
Round(n);
Floor(n);下限整数
Ceiling(n);上限整数
Sign(n);取正/负/0
Real field of precision 30
2.17636684303350970017636684303
2.17636684303350970017636684303
2.17636684303350970017636684303
2.17636684303350970017636684303
2.17636684303350970017636684303
TURE
1
2
2
2
3
1


Infinity() ;∞
MinusInfinity() ;-∞
Infinity() ;
MinusInfinity() ;
NextPrime(n) ;
PreviousPrime(n);
NthPrime(n) ;

lilianjie 发表于 2012-1-11 18:57

n:=123456;

CarmichaelLambda(n+1000);卡米歇函数
FactoredCarmichaelLambda(n);分解卡米歇函数

DivisorSigma(4, n) ;因子和
DivisorSigma(3, n) ;
SumOfDivisors(n);因子和函数
NumberOfDivisors(n);因子函数

EulerPhi(n) ;欧拉数
FactoredEulerPhi(n);分解欧拉数
EulerPhiInverse(n);欧拉函数求逆
FactoredEulerPhiInverse(n) ;欧拉函数求逆分解MoebiusMu(n) ;墨氏函数LegendreSymbol(3, 103);勒让德符号
LegendreSymbol(-3, 103);
LegendreSymbol(34, 103);
LegendreSymbol(12, 13);
LegendreSymbol(19, 3);
JacobiSymbol(15, 13);雅可比符号
JacobiSymbol(15, 13);
JacobiSymbol(150, 103);
KroneckerSymbol(2, 11);
KroneckerSymbol(5, 13);克罗内克符号
KroneckerSymbol(77, 4);

7590
[ <2, 4>, <3, 1>, <107, 1> ]
250845527446699736708
2230091146719632
327152
28
41088
[ <2, 7>, <3, 1>, <107, 1> ]
[ 123457, 131189, 133757, 185187, 216069, 246914, 246916, 246944, 262378,
267514, 288092, 308680, 370374, 370404, 370416, 432138, 463020 ]
[
    [ <2, 1>, <3, 1>, <7, 1>, <10289, 1> ],
    [ <2, 1>, <3, 1>, <61729, 1> ],
    [ <2, 1>, <13, 1>, <10289, 1> ],
    [ <2, 1>, <17, 1>, <7717, 1> ],
    [ <2, 1>, <123457, 1> ],
    [ <2, 2>, <3, 1>, <5, 1>, <7717, 1> ],
    [ <2, 2>, <3, 2>, <10289, 1> ],
    [ <2, 2>, <7, 1>, <10289, 1> ],
    [ <2, 2>, <61729, 1> ],
    [ <2, 3>, <5, 1>, <7717, 1> ],
    [ <2, 4>, <3, 1>, <7717, 1> ],
    [ <2, 5>, <7717, 1> ],
    [ <3, 1>, <7, 1>, <10289, 1> ],
    [ <3, 1>, <61729, 1> ],
    [ <13, 1>, <10289, 1> ],
    [ <17, 1>, <7717, 1> ],
    [ <123457, 1> ]
]
0
-1
1
1
1
1
-1
-1
-1
-1
-1
1

lilianjie1 发表于 2012-1-11 19:35

墨氏函数可表示欧拉函数因子和函数等算术函数

孤寂冷逍遥 发表于 2012-1-12 15:06

{:3_59:}{:3_59:}

苏惟嫣 发表于 2012-1-12 16:43

{:soso_e193:}

孤寂冷逍遥 发表于 2012-1-12 17:01

{:3_59:}{:3_59:}
页: [1]
查看完整版本: 一些初等算术逻缉函数