Prime numbers whose neighboring pairs are tetraprimes: Difference between revisions
Prime numbers whose neighboring pairs are tetraprimes (view source)
Revision as of 08:13, 29 June 2023
, 11 months ago→{{header|Wren}}: Backported Horst's C improvement - runtime down from 6.7 to 4.9 seconds.
m (→{{header|C}}: small improvement for isTetraPrime, to stop earlier. Runtime @home 0.1s -> 0.068 s) |
(→{{header|Wren}}: Backported Horst's C improvement - runtime down from 6.7 to 4.9 seconds.) |
||
Line 1,270:
var prevFact = 1
for (p in primes) {
if (count == 0) {
limit = limit * limit
} else if (count == 1) {
limit = limit * p
}
if (limit <= n) {
while (n % p == 0) {
if (count == 4 || p == prevFact) return false
|