De Polignac numbers: Difference between revisions

→‎{{header|Ruby}}: attribution added
(→‎{{header|Ruby}}: Better way to find pow2)
(→‎{{header|Ruby}}: attribution added)
Line 1,312:
 
=={{header|Ruby}}==
Using Thundergnats observation that it is enough to subtract powers of 2 and verify that none of the results is prime.
<syntaxhighlight lang="ruby">require 'prime'
 
1,149

edits