204 Generalised Hamming Numbers -- v2.pl 335 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. # Daniel "Trizen" Șuteu
  3. # Date: 25 July 2021
  4. # https://github.com/trizen
  5. # How many generalised Hamming numbers of type 100 are there which don't exceed 10^9?
  6. # https://projecteuler.net/problem=204
  7. # Runtime: 0.031s
  8. use 5.010;
  9. use strict;
  10. use warnings;
  11. use ntheory qw(smooth_count);
  12. say smooth_count(1e9, 100);