#!/usr/bin/perl # glat-17.pl # GLAT ANSWER TO #17 # Written by Trey Hunner # Licensed under the GPL # Do not use this to cheat $n = 0; $count = 0; while(1) { $n++; $temp = $n; while($temp =~ /1/g) { $count++; $temp =~ s/1//; } if($n == $count && $n!=1) { print "number: $n; 1-count: $count\n"; exit; } }