Random7 Repeat RAN# n times

Description

Wikipedia - linear congruential generator (LCG)

Introduction
This program shows the limitations of a psuedo-random number generator.
There are patterns, the most notable being the gradual revealing of the original seed value.
The random number sequence repeats after 1E10 numbers have been generated.

Usage
Seed
STO ENTER
Enter numer of iterations N/100, N is the total number of sequential RAN# statements.
GSB A

Notes
After 10 RAN# operations the displayed number ends with the undisplayed 10th digit of the original seed.
The same apples for every 10 RAN# operations from then onwards, until 100 are completed.
In this program this is one iteration, comprising 100 RAN# statements.

After 1 iteration (100 RAN# statements) the x register number ends with the 9th and the undisplayed 10th digit of the original seed.
The same applies for every iteration from then onwards until 10.
This trend continues to 10,000,000 iterations (1E10 RAN# statements) where the initial seed is fully displayed and the random number sequence then repeats.
This takes a few days to complete.

This initial seed number is reconstructed from the right, one digit for every additional iteration decade - 1,10, 100 to 10,000,000.
Between decades the numbers are fairly random.
More original seed digits are revealed on the right each time the counter reduces in magnitude by a decade.
For 10,000,000 iterations (1E10 RAN# statements) the original seed is fully displayed when the counter reaches zero.

This program only displays the final random number, so several iterations of different magnitudes are required to reveal these patterns.
Every random number in the sequence is related to other random numbers by the same patterns.
Cryptographic applications would be unwise as the psuedo-random numbers are pre-determined.

Program Resources

Labels

Name Description
 A Random7
 1 Loop counter

Storage Registers

Name Description
 1 Loop counter

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 036 42 36 f RAN # 072 42 36 f RAN #
001 42,21,11 f LBL A 037 42 36 f RAN # 073 42 36 f RAN #
002 44 1 STO 1 038 42 36 f RAN # 074 42 36 f RAN #
003 42,21, 1 f LBL 1 039 42 36 f RAN # 075 42 36 f RAN #
004 42 36 f RAN # 040 42 36 f RAN # 076 42 36 f RAN #
005 42 36 f RAN # 041 42 36 f RAN # 077 42 36 f RAN #
006 42 36 f RAN # 042 42 36 f RAN # 078 42 36 f RAN #
007 42 36 f RAN # 043 42 36 f RAN # 079 42 36 f RAN #
008 42 36 f RAN # 044 42 36 f RAN # 080 42 36 f RAN #
009 42 36 f RAN # 045 42 36 f RAN # 081 42 36 f RAN #
010 42 36 f RAN # 046 42 36 f RAN # 082 42 36 f RAN #
011 42 36 f RAN # 047 42 36 f RAN # 083 42 36 f RAN #
012 42 36 f RAN # 048 42 36 f RAN # 084 42 36 f RAN #
013 42 36 f RAN # 049 42 36 f RAN # 085 42 36 f RAN #
014 42 36 f RAN # 050 42 36 f RAN # 086 42 36 f RAN #
015 42 36 f RAN # 051 42 36 f RAN # 087 42 36 f RAN #
016 42 36 f RAN # 052 42 36 f RAN # 088 42 36 f RAN #
017 42 36 f RAN # 053 42 36 f RAN # 089 42 36 f RAN #
018 42 36 f RAN # 054 42 36 f RAN # 090 42 36 f RAN #
019 42 36 f RAN # 055 42 36 f RAN # 091 42 36 f RAN #
020 42 36 f RAN # 056 42 36 f RAN # 092 42 36 f RAN #
021 42 36 f RAN # 057 42 36 f RAN # 093 42 36 f RAN #
022 42 36 f RAN # 058 42 36 f RAN # 094 42 36 f RAN #
023 42 36 f RAN # 059 42 36 f RAN # 095 42 36 f RAN #
024 42 36 f RAN # 060 42 36 f RAN # 096 42 36 f RAN #
025 42 36 f RAN # 061 42 36 f RAN # 097 42 36 f RAN #
026 42 36 f RAN # 062 42 36 f RAN # 098 42 36 f RAN #
027 42 36 f RAN # 063 42 36 f RAN # 099 42 36 f RAN #
028 42 36 f RAN # 064 42 36 f RAN # 100 42 36 f RAN #
029 42 36 f RAN # 065 42 36 f RAN # 101 42 36 f RAN #
030 42 36 f RAN # 066 42 36 f RAN # 102 42 36 f RAN #
031 42 36 f RAN # 067 42 36 f RAN # 103 42 36 f RAN #
032 42 36 f RAN # 068 42 36 f RAN # 104 42, 5, 1 f DSE 1
033 42 36 f RAN # 069 42 36 f RAN # 105 22 1 GTO 1
034 42 36 f RAN # 070 42 36 f RAN # 106 43 32 g RTN
035 42 36 f RAN # 071 42 36 f RAN #