LCRNGDOC àRA#€ ‰®H
¾T*sU¥LCRNGDOC: LONG CYCLE RANDOM NUMBER GENERATOR * 0 @ PQ This method is the best method for generating a long cycle of random numbers in`Q basic or focal using easily calculated paramaters, in this case the multiplierspQ and primes. Its disadvantage is that the longer the cycle length, the longer€Q the running time. In running the program there should be no rounding errors.Q SK1The total cycle length is the LCM of the individual cycle lengths. ChooseQ primes so that the different (prime-1)s have only one two and no other factor inQ common,65537 is a valid prime even though 65536 has 16 factors of two, but no Q other (prime-1) may have more than one factor of two. To take an extreme0Q example, the primes 5,7 and 13 are a bad choice, as the LCM of 4,6 and 12 is 12@0 giving the same cycle length of 13 on its own. P `Q Check that the multiplier gives a cycle length of one less than its prime. IfpQ the result of TEST41 or TEST75 for any factor is one, choose another multiplier€8 and test with all the factors again. For TEST75 follow , Multiplier Enter Factor Enter Prime R/S3 8204 Enter 2 Enter 999953 R/S 999952 3 8204 Enter 62497 Enter 999953 R/S 4757010 @A For the prime 999953 the factors of 999952 are 2,2,2,2 and 62497P `Q TEST41 works with a prime less than 5E9; TEST75 works with a prime number of sixp digits or less. € Q The seed can be any positive integer between 1 and (Prime-1). If you do notQ want to calculate your own, the following multipliers and primes are suggested. = 5993 999959 / 8204 999953 / 9626 999931 / 8496 9998630 @ PQ RNG41 and RNG75 generate the random numbers. A local numerical label leads to a`Q faster running program; the alpha registers have not been used as the callingpQ program may use them. RNG41 uses three multipliers, primes and seeds but can be€Q adapted to use more. Store the range in R00; if 0 to 199 is reqired then store 200 in R00 $ R01 Prime 1 R04 Mult 1 R07 Seed 1 $ R02 Prime 2 R05 Mult 2 R08 Seed 20$ R03 Prime 3 R06 Mult 3 R09 Seed 3@ SK1P `Q If you are using this routine as part of a cypher program, choose your ownpQ multipliers and primes. Add the date and the time to standard seeds 1 and 2 and€Q then mod their primes. If the result is zero, reverse the date and time. InQ this way, you do not generate the same sequence of random numbers. Include the date and time in your message. M.F. MOORE [#375]™©Šndard seeds 1 and 2 and€Q then mod their primes. If the result is zero, reverse the date and time. InQ this way, you do not generate the same sequence of ran