0

First: By entering the caption math.SE listed a bunch of posts but none answerd my question. So I dare to ask:

Taking a closer look to the ancient HP-21S pocket calculator reveals the nature of its RAN# function. It's a multiplicative congruential generator, computing $s_{k+1} = a\cdot s_k \pmod m$ with $a=2851130928467$ (a prime) and $m=10^{15}$ (it's a BCD machine).

Question: What is the period length of $$s_{k+1} = 2851130928467\cdot s_k \pmod {10^{15}}$$

What I found so far:

  • According to Wikipedia this algorithm returns a Weyl sequence, thus it is not a full period LCG.
  • Obviously all returned $s_n$ are odd (at least those of ~10 test runs).
  • Maybe the period could be calculated with a Carmichael function, but even with the shown numerical examples I am not able to repeat it with the a. m. numbers.
  • I try to get it by brute force, but the "force" of my PC did not finish it within one day.

A simple answer like period is -- for sure, no doubt -- $m/4$ would do. TY in advance.

Trivia: User input for seed is forced to be odd, last digit is set to 1. A seed $s_k=0$ is replaced by $999500333083533$. Output RN for the user are only the 12 most significant digits of $s_{k+1}$, normalized to the range $[0..1[$
(I took the a. m. "closer look to the ancient HP-21S" with an emulator running the original calculator firmware.)

m-stgt
  • 575
  • Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on [meta], or in [chat]. Comments continuing discussion may be removed. – Xander Henderson Apr 28 '24 at 13:09
  • As here, in this case $,o(a) = 2^{13}!\pmod{!2^{15}}$ and $,o(a) = 4\cdot 5^{14}!\pmod{!5^{15}}$ so mod $10^{15}$ it has order being their lcm $= 5\cdot 10^{13}.\ \ $ You could also find that using the linked algorithm by a few calculations (e.g. here and here and here prove it by the Order Test), i.e. the order divides $n= 5\cdot 10^{13},$ but does not divide $n/5$ or $n/2$ so must be $n., $ See the prior-linked chat for further discussion, and see the linked dupe for general methods. – Bill Dubuque May 18 '24 at 19:23
  • @BillDubuque -- TY for comming back to this subject. The period length of $5\cdot 10^{13}$ you told me already in the chat (it is frozen meanwhile). But I had some more questions which still are waiting to be answered ;) – m-stgt May 18 '24 at 23:51

0 Answers0