daniellindhaga

10 Reputation

One Badge

7 years, 275 days

MaplePrimes Activity


These are questions asked by daniellindhaga

How do I apply select to a set element-wise?

I have defined a procedure which computes the order of an element g mod p.

findOrderOf:=proc(g,p)
  local i:=1;
  local gpwr:=1;
  for i from 1 to p-1 do
    gpwr:=gpwr*g mod p;
    if(gpwr = 1) then:
      return i;
    end if:
  end do:
end proc:

I then want to select the primes which are generated by 2 and 3.

primes:=select(isprime,[`$`(2000 .. 3000)]);
select(findOrderOf(2,x=p)=p-1 and findOrderOf(3,x=p)=p-1,primes);

I am stuck with how to make the last line work.

 

 

Page 1 of 1