Quad-power prime seeds: Difference between revisions

Content added Content deleted
(→‎{{header|Wren}}: Added 10 million for consistency with 'penta' task.)
Line 60: Line 60:
p.setUi(n)
p.setUi(n)
var k = n + 1
var k = n + 1
return (p + k).probPrime(15) > 0 &&
return (p + k).probPrime(15) > 0 &&
(p.mul(n) + k).probPrime(15) > 0 &&
(p.mul(n) + k).probPrime(15) > 0 &&
(p.mul(n) + k).probPrime(15) > 0 &&
(p.mul(n) + k).probPrime(15) > 0 &&
Line 82: Line 82:
c = c + 1
c = c + 1
if (n > m * 1e6) {
if (n > m * 1e6) {
Fmt.print(" $d million is the $r: $,d", m, c, n)
Fmt.print(" $2d million is the $r: $,10d", m, c, n)
m = m + 1
m = m + 1
if (m == 10) return
if (m == 11) return
}
}
}
}
Line 100: Line 100:


First quad-power prime seed greater than:
First quad-power prime seed greater than:
1 million is the 141st: 1,009,286
1 million is the 141st: 1,009,286
2 million is the 234th: 2,015,496
2 million is the 234th: 2,015,496
3 million is the 319th: 3,005,316
3 million is the 319th: 3,005,316
4 million is the 383rd: 4,004,726
4 million is the 383rd: 4,004,726
5 million is the 452nd: 5,023,880
5 million is the 452nd: 5,023,880
6 million is the 514th: 6,000,554
6 million is the 514th: 6,000,554
7 million is the 567th: 7,047,129
7 million is the 567th: 7,047,129
8 million is the 601st: 8,005,710
8 million is the 601st: 8,005,710
9 million is the 645th: 9,055,151
9 million is the 645th: 9,055,151
10 million is the 701st: 10,023,600
</pre>
</pre>