# project-euler/134/euler-134.pl

+Consider the consecutive primes p1 = 19 and p2 = 23. It can be verified that

+1219 is the smallest number such that the last digits are formed by p1 whilst

+also being divisible by p2.

+In fact, with the exception of p1 = 3 and p2 = 5, for every pair of consecutive

+primes, p2 > p1, there exist values of n for which the last digits are formed

+by p1 and n is divisible by p2. Let S be the smallest of these values of n.

+Find ∑ S for every pair of consecutive primes with 5 ≤ p1 ≤ 1000000.

+ $mod = (($mod * 10 + 1) % $n);

+ while (($A & 0x1) == 0)

+open my $primes_fh, "(primes 5 1100000)|";

+my $p1 = int(<$primes_fh>);

+while ($p2 = int(<$primes_fh>))

+ my $mod_delta = ((1 . ('0' x length($p1))) % $p2);

+ ($mod += $mod_delta) %= $p2;

+ print "For (p1=$p1,p2=$p2) found $S (sum=$sum)\n";