Search Problems   RSS Feed
projecteuler.net

Median of Products

 Published on Sunday, 10th April 2022, 08:00 am and solved by 965
Difficulty: Level 17 [45%]

Problem 793

Let $S_i$ be an integer sequence produced with the following pseudo-random number generator:

  • $S_0 = 290797$
  • $S_{i+1} = S_i ^2 \bmod 50515093$

Let $M(n)$ be the median of the pairwise products $ S_i S_j $ for $0 \le i \lt j \lt n$.

You are given $M(3) = 3878983057768$ and $M(103) = 492700616748525$.

Find $M(1\,000\,003)$.



Copied to Clipboard