Formula / calculation of the function random() / randomSeed()
The underlying random() function isn't part of the Arduino code. It's actually part of avr-libc. The Arduino IDE only comes with pre-compiled object code for it (as far as I know).

It's open source though. You can get information about it here:


http://www.nongnu.org/avr-libc


If you look down the page a short way, you'll find the "Source code and documentation" link.

The random() function is under libc/stdlib/random.c. I would paste the source code here, but technically I'd have to include a whole copyright notice with it.