Post Reply 
Request for "Decimal Period of 1/X in Base Y" program
01-21-2018, 09:17 PM (This post was last modified: 01-21-2018 09:34 PM by StephenG1CMZ.)
Post: #25
RE: Request for "Decimal Period of 1/X in Base Y" program
(02-27-2015 08:49 AM)Thomas Ritschel Wrote:  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;

I am using this procedure to analyze repeating decimals/recurring decimals here:
http://www.hpmuseum.org/forum/thread-9986.html

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Request for "Decimal Period of 1/X in Base Y" program - StephenG1CMZ - 01-21-2018 09:17 PM



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