Hacker News new | past | comments | ask | show | jobs | submit login
My primality testing code is faster than Sir Roger Penrose's (jgc.org)
124 points by jgrahamc 10 months ago | hide | past | favorite | 25 comments



1m44s to show 199 prime, I'm glad I've never had to deal with that kind of compute power! Almost more feasible to just hardcode the e.g. 8 divisor tests you need to prove numbers up to 528 prime and say anything else larger would be too slow!


> I'm glad I've never had to deal with that kind of compute power

And yet I'd say you missed out. It was an amazing time to be messing with computing technology.


I think this is the longest-running game of code golf (maybe golf is the wrong term) I've ever seen. The state trick feels almost out of place in a BASIC-esque language, but I love it.


Yup. It started in the 3rd century BC https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes


The prime has to be at least... three times bigger than this!


Make this man Sir J Graham C immediately


I will only accept a peerage as I wish to be known as Lord Binary.


You can only get a peerage if you will meet with the Crown in at least three geographically diverse points, and traffic flows must be roughly balanced between you and the Crown.


Lord Binary, Zeroth of his name, King of the Hex Isles and of the First Bootloaders, Protector of the seven networks, and Father of Kernels. The indexer of the great vast object store, the decompiled, the breaker of solvers.


I guess it makes sense that off-by-zero was listed before cache invalidation.


What is the red circular diagram on the upper left? I watched a physics lecture that I understood nothing of in which the lecturer drew a similar diagram on the blackboard.


The one you saw on the blackboard may also be the Smith chart: https://en.wikipedia.org/wiki/Smith_chart


Is the Poincaré disk, a compact hyperbolic 2-d manifold. A space with negative curvature and maximal symmetry, the equivalent of a sphere but with negative curvature if you will.

You may have seen something similar in holography and AdS/CFT context. Or in an Escher painting.


Subdivisions of the hyperbolic plane. Propably more for the patterns then physics here.


Great article. Loved the detail and the description for why he might have done it the other way.


Fun fact: jgc (John Graham-Cumming) is the person that started the petition that forced the UK government to publicly apologize for its harsh treatment and persecution of Alan Turing.


Related. Others?

Beware the Alan Turing fetish - https://news.ycombinator.com/item?id=4702793 - Oct 2012 (63 comments)

The perl script that powered the Alan Turing petition - https://news.ycombinator.com/item?id=4207252 - July 2012 (7 comments)

UK government declines to pardon Alan Turing - https://news.ycombinator.com/item?id=3556763 - Feb 2012 (83 comments)

Beware the Alan Turing fetish - https://news.ycombinator.com/item?id=3260639 - Nov 2011 (41 comments)

The complete text of Gordon Brown's apology to Alan Turing - https://news.ycombinator.com/item?id=2767301 - July 2011 (3 comments)

The Genius of Turing - https://news.ycombinator.com/item?id=2151254 - Jan 2011 (23 comments)

The British Government should apologize to Alan Turing - https://news.ycombinator.com/item?id=670149 - June 2009 (76 comments)


By far the best summary of the situation was my interview with Steven Levy: https://www.wired.com/2014/11/the-man-who-made-the-uk-say-im...


The "Beware the Alan Turing Fetish" link doesn't point to an existing page anymore.


Ah. It was an appeal to people to stop naming everything after Turing because the UK went a bit Turing mad for a while.


A wise move to stop the UK becoming accidentally Turing complete.


A phenomenon one could aptly call Turing Mania (TM).


I didn't know that. Respect!


offtopic: https://getpopfile.org/ throws an argo tunnel error


Yes, I know. I'm in the OOB console to the VPS looking at that right now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: