Post Reply 
Request for "Decimal Period of 1/X in Base Y" program
02-27-2015, 08:49 AM
Post: #2
RE: Request for "Multiplicative Order of Y (mod X)" program
Here is a simple non-CAS variant:
Code:
EXPORT MultiplicativeOrder(a,base)
BEGIN
  LOCAL k:=0;
  LOCAL res:=1;
  REPEAT
    res:=res*base;
    k:=k+1;
    res:=res MOD a;
  UNTIL res==1;
  RETURN(k);
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Request for "Multiplicative Order of Y (mod X)" program - Thomas Ritschel - 02-27-2015 08:49 AM



User(s) browsing this thread: 3 Guest(s)