[euler] refactor repeated code into its own routine
[euler] refactor repeated code into its own routine

stmuk/perl6-examples,perl6/perl6-examples,stmuk/perl6-examples,perl6/perl6-examples,shlomif/perl6-examples,Quinny/perl6-examples,shlomif/perl6-examples,Quinny/perl6-examples,Quinny/perl6-examples,shlomif/perl6-examples,stmuk/perl6-examples,stmuk/perl6-examples,perl6/perl6-examples,Quinny/perl6-examples,perl6/perl6-examples,shlomif/perl6-examples,shlomif/perl6-examples,Quinny/perl6-examples,perl6/perl6-examples,stmuk/perl6-examples