#!/usr/local/bin/perl

#
# This code acts as a rudimentary tool to find nontrivial arithmetic
# progressions among primes; it fills one screenful with the primes
# less than 2000 marked.
#

@primes=(2,3,5,7,11,13,17,19,23,29,31,37,41,43);

for($i=0; $i<23; $i++) {
   for($j=0; $j<80; $j++) {
	$foo=1; $n=$i*25+$j;
	foreach $p (@primes) {
	    $foo*=$n%$p if $p<$n;
	}
 	if($foo==0) {
 	    print " ";
 	}
 	else {
 	    print "#";
 	}
    }
   print "\n"; 
}

#sleep 10;
