Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fermat number
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Applications of Fermat numbers== ===Pseudorandom number generation=== Fermat primes are particularly useful in generating pseudo-random sequences of numbers in the range 1, ..., ''N'', where ''N'' is a power of 2. The most common method used is to take any seed value between 1 and {{nowrap|''P'' β 1}}, where ''P'' is a Fermat prime. Now multiply this by a number ''A'', which is greater than the [[square root]] of ''P'' and is a [[Primitive root modulo n|primitive root]] modulo ''P'' (i.e., it is not a [[quadratic residue]]). Then take the result modulo ''P''. The result is the new value for the RNG. : <math>V_{j+1} = (A \times V_j) \bmod P</math> (see [[linear congruential generator]]) This is useful in computer science, since most data structures have members with 2<sup>''X''</sup> possible values. For example, a byte has 256 (2<sup>8</sup>) possible values (0β255). Therefore, to fill a byte or bytes with random values, a random number generator that produces values 1β256 can be used, the byte taking the output value β1. Very large Fermat primes are of particular interest in data encryption for this reason. This method produces only [[pseudorandom]] values, as after {{nowrap|''P'' β 1}} repetitions, the sequence repeats. A poorly chosen multiplier can result in the sequence repeating sooner than {{nowrap|''P'' β 1}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)