What is the algorithm for the increasing shiny chance in 4th gen?

Thank you.

(EDIT) If there is a site with a calculator for this, it would be nice if someone could link me to it.

> The formula for the probability of finding a Shiny Pokémon. Nc is the number of Pokémon in the chain, up to 40. The chances are calculated so that any shaking patch found in or after a chain of 40 has a 1 in 200 probability of being Shiny. ~ Bulbapedia

You mean the real formula?

*Chance = (14747 - 40ChainNumber)/2621440(41-ChainNumber)** -Serebii

If you want to know how to do it, then read these links: Smogon Bulbapedia Pokemon Wiki