(written from a Production point of view)
The number 47 makes frequent recurrences in dialogues and on computer screens in Star Trek.
The origin of the significance of 47 can be traced to Next Generation and Voyager writer Joe Menosky, who attended Pomona College in California. There is a club at Pomona called The 47 Society, which claims that there exists a mathematical proof that all numbers are equal to 47, and that the number 47 occurs with greater frequency in nature than other numbers – 74 makes frequent reappearances as well.
Joe Menosky first started including references to 47 in his scripts in the fourth season of TNG, and the in-joke quickly caught on among the rest of the staff. Since then, references to 47 have been included in many episodes and movies of all the modern series.
When asked about the significance of the number, Rick Berman once joked, "47 is 42, corrected for inflation" referring to 42 being "the answer to the Ultimate Question of Life, the Universe, and Everything" according to The Hitchhiker's Guide to the Galaxy by Douglas Adams.
In Star Trek Online, the MMORPG by Cryptic Studios, a major hub for Federation players to interact inside Earth Spacedock is on Deck 47. Off to the side of the promenade on Earth Spacedock, a player can dance at Club 47.