Talk:De Polignac numbers: Difference between revisions

m
→‎Efficient algorithm: reword, correct order of operations
(commentary)
 
m (→‎Efficient algorithm: reword, correct order of operations)
Line 4:
It is not necessary to test add every power of 2 less than N with every prime less than N and check if the sum is N.
 
Simply find the powers of 2 less than N, subtract Neach from eachN, and check if theany remainder is a prime. If any is, it is '''not''' a de Polignac number. Short circuit and move on. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 22:04, 27 September 2022 (UTC)
10,333

edits