Nova, Sandran, KillerSwift, you may join!
Shido: That formula sounds like BS to me. And since when do natures have upper and lower values? The only truth I can see in that is that Nature is calculated by taking the mod-25 of the PV. The mod-5 of that value gives you the lowered stat; the value divided by 5 (rounding down) gives you the stat which is raised. Attack=0, Defense=1, Speed=2, Special Attack=3, Special Defense=4.
Shininess is calculated by XORing four values: the Trainer ID, the Hidden ID, the upper 16 bits of the PV, and the lower 16 bits of the PV. Your Trainer IDs are each 16 bits. Lop off the 3 lowest order bits, and if the result is 0, you have a shiny. (Equivalently, you can see if the value is 7 or less instead of lopping off the 3 lowest order bits.)
There's a ton of equivalent ways of representing the shiny formula. One of the more important ones is to seperate the constant parts from the equation. XOR your Trainer ID and Hidden ID. Knock off the 3 lowest bits. The result is a number between 0 and 8191: this is your "Shiny ID." For each Pokémon, take the XOR of the upper and lower 16 bits of the PV and lop off the 3 lowest from the result. If it matches your Shiny ID, you have a shiny. This is the simplest way to represent the egg trading effect, where an egg may contain a shiny if hatched by one trainer, but not by another: your Shiny IDs are different.
I suppose you could also consider an "Extended Trainer ID", which would be a 32 bit integer where the first 16 bits come from your Trainer ID and the last 16 come from your Hidden ID. It won't look like your Trainer ID because your Trainer ID is always shown in decimal.
7232 Treeckos seen ±131, 90% of the time.