Problem 793, and others
Posted: Sun Apr 10, 2022 11:01 am
Let $S_i$ be an integer sequence produced with the following pseudo-random number generator:
$S_0 = 290797$</li>
$S_{i+1} = S_i ^2 \bmod 50515093$</li>
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)$.
Hello,
I started taking a look into Euler problems few months ago, went over the first 100+ ones. Every week I take a look at the newly published Euler problem. The time complexity seems unreachable for me on those latter problems. While I have fun solving 50+ % difficulty problems published 10 years ago, I don't have a clue on how to solve the last problems, even tho some look really easy, but they just seems too much.
For example, last problem 793 seems very easy, some have solved it in 4 minutes. And yet I don't see any solution that wouldn't require $O(1\,000\,003^2)$ products. I don't know about you, but that's hours, if not days, of time-computing on my PC.
And this seems to be true for most recent Euler problems. Time computations just seem out of my mind.
So I'm kinda confused. To be clear, I don't want this specific, or any other, problem solution. I just want the situation to be clarified :
1) First, am I wrong or this specific problem definitely requires to find a way to efficiently compute $1\,000\,003^2$ operations ?
2) If so, is it feasible on a normal computer ? Have Euler problems adapted to people using parallel computer networks by upraising their time-computations required to solve problems ? Or do I just need to program better ?
Thanks in advance if anyone can enlighten me.
$S_0 = 290797$</li>
$S_{i+1} = S_i ^2 \bmod 50515093$</li>
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)$.
Hello,
I started taking a look into Euler problems few months ago, went over the first 100+ ones. Every week I take a look at the newly published Euler problem. The time complexity seems unreachable for me on those latter problems. While I have fun solving 50+ % difficulty problems published 10 years ago, I don't have a clue on how to solve the last problems, even tho some look really easy, but they just seems too much.
For example, last problem 793 seems very easy, some have solved it in 4 minutes. And yet I don't see any solution that wouldn't require $O(1\,000\,003^2)$ products. I don't know about you, but that's hours, if not days, of time-computing on my PC.
And this seems to be true for most recent Euler problems. Time computations just seem out of my mind.
So I'm kinda confused. To be clear, I don't want this specific, or any other, problem solution. I just want the situation to be clarified :
1) First, am I wrong or this specific problem definitely requires to find a way to efficiently compute $1\,000\,003^2$ operations ?
2) If so, is it feasible on a normal computer ? Have Euler problems adapted to people using parallel computer networks by upraising their time-computations required to solve problems ? Or do I just need to program better ?
Thanks in advance if anyone can enlighten me.