#!/usr/bin/perl @lets = (10,10,12,11,11,10,12,12,11); open(FIL,"prob17data.txt"); $l = join('',); close(FIL); $l =~ s/[^a-z]//g; $first = length($l); print "1-99: " . $first . "\n"; $tot = $first; for ($i = 0; $i <= $#lets; $i++) { $group = 100 * ($lets[$i]) + $first + 99 * 3; $tot += $group; print "" . ($i + 1) . "00-" . ($i + 1) . "99: $group\n"; } $tot += 11; #for "one-thousand" print "Total: $tot\n";