This reminds me of my favorite in-person magic trick to do.<p>First, memorize all the two-digit primes. 25 numbers isn't that hard to memorize.<p>Then, tell someone "Oh, I can instantly tell whether a number is prime or not. Give me a number, I'll tell you whether it's prime."<p>If they tell you a number between 1 and 100, use your memorized list. Otherwise, it's a game of cold reading; if they just generated a random string of many digits, there's a low chance that the number actually is prime. "21923847" is a keysmash, and it's almost certainly not prime, because the frequency of primes goes down as numbers get bigger. And most people will ask you a number, hear "no", and then go check the number's primality. Eventually, they'll look up a number in advance; that number is almost certainly prime.
I love these simple web games! Great idea. One way to improve it is to add some more juice when you answer a question. Right now, the text in the number just swaps to the next question, so any sort of small visual feedback will help first time players get it more.<p>I also like to make these small web mini games on the side. Here's one where you guess the year that famous events happened: <a href="https://guess-the-year.davjhan.com/" rel="nofollow">https://guess-the-year.davjhan.com/</a>
If I click start, then paste some quick and dirty browser automation in the console:<p><pre><code> function c(){is_prime(document.getElementById('n').textContent)==="prime"?yes.click():no.click();window.setTimeout(c,1)};c()
</code></pre>
My old laptop can guess right 16k times and get up to 4172973243025599, but then the http post to do the stats (record.php) bombs with a MySql error <i>"Out of range value for column 'end' at row 1"</i> :)
After lots of 2-digit numbers ending in 5 came up, my brain went on autopilot thinking "any number that ends in 5 is not a prime". I lost when 5 came up.
I've started, if I wake up in the middle of the night, thinking of a 'prime-looking' number, then trying to factor it. Sometimes I discover interesting connections, other times I fall back asleep - either is a win.
Good practice for learning divisibility rules <a href="https://en.m.wikipedia.org/wiki/Divisibility_rule" rel="nofollow">https://en.m.wikipedia.org/wiki/Divisibility_rule</a>
This is really cool! I made a very similar game a couple years ago: <a href="https://jew.ski/prime-time/" rel="nofollow">https://jew.ski/prime-time/</a><p>It's interesting to compare the game play and design. My game is written in Elm and open source if anyone is interested. This website has keyboard inputs (y or n) which is a good idea. My game only does click/touch inputs.
Is there a reason we're obsessed with primes beyond aesthetics? Why does this set of numbers garner all the headlines as opposed to some other arbitrary integer sequence like the Recamán numbers [0] ?<p>If tomorrow someone discovered a closed-form equation for the nth prime, how would mathematics/the world change?<p>[0] <a href="https://en.wikipedia.org/wiki/Recamán%27s_sequence" rel="nofollow">https://en.wikipedia.org/wiki/Recamán%27s_sequence</a>
I've spent a good week of straight hours on primes by now, the most fun thing I've come up with was this boring sieve.<p><a href="https://github.com/alexlieberman/Prime-Numbers/blob/master/SixSieve.java" rel="nofollow">https://github.com/alexlieberman/Prime-Numbers/blob/master/S...</a>
I'm using this as a metric to determine if my brain is deteriorating. (my age) + (my best score, without more than a few minutes of 'training') > 80 means I'm still doing OK.<p>Today, at 56 years wise, I scored 34, so 90 > 80. Means I judge myself to be smart enough to put my shoes on the correct feet, still.
I am not doing _that_ type of number crunching in my daily work, so the following check (in Python) has probably lots of potential for improvement:<p><pre><code> def is_prime(n):
return not True in [n%x == 0 for x in range(2, n/2)]</code></pre>
I think this question is framed the wrong way for me. I think if the question was "Is this composite?" I would get much better scores. The way I think is "Does it have a factor?" and inverting that Boolean trips me up.
I love it, but the game doesn't work for me! No response when I click Yes or No, or using the keyboard y and n. Just the clock ticking down. Chrome Version 91.0.4472.114 (Official Build) (64-bit) on Windows 10 Enterprise.
I’ve always wondered: how feasible is it to implement an “isprime” function, via lookup table? If such methods are used, is cryptography getting weaker and weaker in practice as more large primes are discovered?
I really like it.<p>I wonder if the text could be dropped once it starts. I found myself reading it each time which ended up distracting me a little and sometimes I would rush and tapped the opposite of what I intended.