aboutsummaryrefslogtreecommitdiff
path: root/challenge-046/peter-scott/perl/ch-2.sh
blob: 4f08c97049b00daf127b1236f2ffc9fa3a3f7ecd (plain)
1
2
3
#!/bin/sh
perl -E '$N=shift; @R=(0)x$N; for $e (1..$N){ for ($r = $e; $r < $N; $r += $e ) { $R[$r-1] ^= 1 } } say for grep { $R[$_-1] } 1..$N' 500