Sponsoring The Perl Toolchain Summit 2025: Help make this important event another success Learn more

#!/usr/bin/perl
use strict;
use constant MAX => 100_000;
my $max = int($ARGV[0] || MAX);
my $progress = Term::ProgressBar->new($max);
for (0..$max) {
my $is_power = 0;
for(my $i = 0; 2**$i <= $_; $i++) {
$is_power = 1
if 2**$i == $_;
}
$progress->update($_);
}