-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathabout.html
28 lines (28 loc) · 2.5 KB
/
about.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="about-style.css"></link>
</head>
<body class="about">
<header>
<h1>Is this prime?</h1>
</header>
<p>This site has one job: to tell you whether a given number is prime or not.</p>
<p>If you go to, for example, <a href="/57">isthisprime.com/57</a>, it will tell you that <span class="number">57</span> is not a prime number.</p>
<h2>How it works</h2>
<p>For numbers up to 10 digits long, it uses the <a href="https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants_of_the_test">deterministic Miller test</a> to determine if the number is prime, with 100% certainty.
This is a remarkably clever algorithm which can decide primality in logarithmic time.</p>
<p>For larger numbers, it uses the <a href="https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test">probabilistic Miller-Rabin test</a> to make a pretty good guess about whether the given number is prime. "Pretty good" in this case means "practically certain" - you're very unlikely to type in a number which the algorithm says is probably prime but which is in fact composite. However, when the algorithm says a number is composite, it's definitely composite.</p>
<p>For numbers up to 25 digits long, the Miller-Rabin test can give definite answers for primes up to about 25 digits long, by <a href="https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Deterministic_variants">using a set of "witness" bases</a>.</p>
<p>If I was cleverer, I'd pay more attention to the intricacies of these tests to make them run faster and be more certain, but I'm already at the edge of my understanding.</p>
<h2>Extras</h2>
<p>You can turn on screensaver mode by adding <code style="display:inline-block;">?screensaver</code> to the end of the URL, e.g. <a href="/57?screensaver">isthisprime.com/57?screensaver</a>. It'll automatically move on to the next number every 5 seconds.</p>
<p>You can have it show the current UNIX timestamp (the number of seconds since new year, 1970) by going to <a href="/now">isthisprime.com/now</a>.</p>
<p>If <strong>you</strong> would rather decide what's prime and what's not, try the <a href="/game"><strong>Is this prime?</strong> game</a>.</p>
<footer>
<p><a href="http://somethingorotherwhatever.com">Christian Lawson-Perfect</a> made this.</p>
</footer>
</body>
</html>