Skip to content

Instantly share code, notes, and snippets.

@diakopter
Created February 23, 2011 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diakopter/839726 to your computer and use it in GitHub Desktop.
Save diakopter/839726 to your computer and use it in GitHub Desktop.
my $limit = 32;
sub powers_of ($radix) { 1,[\*] $radix xx * }
my @hammings =
( powers_of(2)[^ $limit ] X*
( powers_of(3)[^($limit * 2/3)] X*
powers_of(5)[^($limit * 1/2)]
)
).sort;
say ~@hammings[^20];
say @hammings[1690]; # zero indexed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment