Matt Owen

source code for "files/pe/pe_040.pl"

return to portfolio
  1.  #!/usr/bin/perl
  2.  
  3.  use strict;
  4.  use warnings;
  5.  
  6.  # this is a stupid brutish solution.
  7.  # the math of this problem isn't interesting
  8.  
  9.  my $k = 1;
  10.  my $str = '';
  11.  
  12.  $str .= $k++ while length $str < 10**6;
  13.  
  14.  $k = 1;
  15.  $k *= substr($str, 10**$_-1, 1) for (0..6);
  16.  
  17.  print $k;