aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-158/cheok-yin-fung/dart/ch-2.dart3
1 files changed, 2 insertions, 1 deletions
diff --git a/challenge-158/cheok-yin-fung/dart/ch-2.dart b/challenge-158/cheok-yin-fung/dart/ch-2.dart
index 08b2ad77b0..265cae1291 100644
--- a/challenge-158/cheok-yin-fung/dart/ch-2.dart
+++ b/challenge-158/cheok-yin-fung/dart/ch-2.dart
@@ -18,7 +18,8 @@ void main(List<String> args) {
while (pp <= arg) {
if (pp % 5 == 0) continue; // pp must be coprime to 2 and 3.
if (spokes.last <= sqrt(pp)) {
- for (int k=1; k*30 <= sqrt(pp); k++)
+ var k = ((spokes.last+1)/30).floor();
+ for (; k*30 <= sqrt(pp); k++)
rp_to_30.forEach( (e) => spokes.add(e+k*30) );
}
y++;