← Complete problem index

PROJECT EULER · #0803

Pseudorandom Sequence

Statement only · UnsolvedOriginal problem ↗

Rand48 is a pseudorandom number generator used by some programming languages. It generates a sequence from any given integer 0≤a0<248 using the rule an=(25214903917⋅an−1+11)mod248.

Let bn=⌊an/216⌋mod52. The sequence b0,b1,… is translated to an infinite string c=c0c1… via the rule:
0→ a, 1→ b, …, 25→ z, 26→ A, 27→ B, …, 51→ Z.

For example, if we choose a0=123456, then the string c starts with: "bQYicNGCY…".
Moreover, starting from index 100, we encounter the substring "RxqLBfWzv" for the first time.

Alternatively, if c starts with "EULERcats…", then a0 must be 78580612777175.

Now suppose that the string c starts with "PuzzleOne…".
Find the starting index of the first occurrence of the substring "LuckyText" in c.

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.