Sponsored links: Algebra eBooks
 

Related

ifactors-next_prime

p1:next_prime(1111112...

p2:next_prime(4534576...

p:p1*p2;

Calculate

ifactors-primep

primep(3542436256);

p:325231;

ifactors(p);

Calculate

ifactors-is-lambda-length-second-sublist

is( length( sublist(i...

lambda([x], is(second...

sublist(ifactors(272)...

Calculate

ifactors-random

joukko:[30, 42, 70];

luku: joukko[random(3)];

ifactors(luku);

Calculate

ifactors-lambda-second-sublist

ifactors(17);

sublist(ifactors(17),...

Calculate

ifactors-primep

primep(325232112);

p:325231;

ifactors(p);

Calculate

ifactors-primep

primep(1531846);

p:131;

ifactors(p);

Calculate

ifactors-jacobi-mod

ifactors(138);

ifactors(883);

jacobi(3,23);

Calculate

ifactors-lambda-length-second-sublist

ifactors(17);

sqs: sublist(ifactors...

is(length(sqs) < 1);

Calculate

ifactors

ifactors(40);

Calculate

ifactors

Run Example
(%i1)joukko:[30, 42, 70];
(%o1)                            [30, 42, 70]
(%i2) luku: joukko[random(3)];
(%o2)                                 42
(%i3) factors_only: true;
(%o3)                                true
(%i4) tekijat: ifactors(luku);
(%o4)                              [2, 3, 7]
(%i5) delete(3, tekijat);
(%o5)                               [2, 7]
(%i6) 
Run Example
phi(n) := block(    [lst : ifactors(n)],    product(map(lambda([x], (first(x)-1) * first(rest(x))), lst)[i], i, 1, length(lst)));
(%o1) phi(n) := block([lst : ifactors(n)], 
product(map(lambda([x], (first(x) - 1) first(rest(x))), lst) , i, 1, 
                                                            i
length(lst)))
(%i2) trace(phi);
(%o2)                                [phi]
(%i3) trace(map);
(%o3)                                [map]
(%i4) trace(product);
(%o4)                              [product]
(%i5) trace(ifactors);
(%o5)                             [ifactors]
(%i6) map(lambda([x], phi(x)), [56]) ;
1 Enter map [map(lambda([x], phi(x)), [56])]
 1 Enter phi [56]
  1 Enter ifactors [56]
  1 Exit  ifactors [[2, 3], [7, 1]]
  1 Enter product 
[product(map(lambda([x], (first(x) - 1) first(rest(x))), lst) , i, 1, 
                                                             i
length(lst))]
   2 Enter map [map(lambda([x], (first(x) - 1) first(rest(x))), lst)]
   2 Exit  map [3, 6]
   2 Enter map [map(lambda([x], (first(x) - 1) first(rest(x))), lst)]
   2 Exit  map [3, 6]
  1 Exit  product 18
 1 Exit  phi 18
1 Exit  map [18]
(%o6)                                [18]
(%i7) 
Run Example
ifactors(563);
(%o1)                             [[563, 1]]
(%i2) mod(73,3);
(%o2)                                  1
(%i3) 

Related Help

Help for Ifactors