Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to develop a method to compute the seed value after n steps. I first wanted to use a loop, but I thought maybe someone comes up with a nice single expression and could also say something about the process.

I guess you have to use mathematical induction to solve that...

$x_0 = \mathtt{seed}$

$ x_1 = (x_0 \cdot \mathtt{0x5DEECE66D} + \mathtt{0xB})~\mathtt{AND}~((1~ \mathtt{SHIFTL}~48) - 1) $

$x_n = \dots$

All the values are 64-bit java long numbers. More information can be found here: What I basically want to do is to copy an instance of Random object, so that copy behaves same.

share|cite|improve this question
I managed to create a copy of a random object But I'm still interested in the solution, though. – mike Aug 30 '13 at 13:39

I suggest using this service.

Or, if you want to write the code yourself, I suggest starting here.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.