It doesn't specify to calculate them, only to list them; why throw away all of the computer millenia of processing power that the GIMPS has invested?
use HTTP::UserAgent;
use Gumbo;
my $table = parse-html(HTTP::UserAgent.new.get('https://www.mersenne.org/primes/').content, :TAG<table>);
say 'All known Mersenne primes as of ', Date(now);
say 'M', ++$, ": 2$_ - 1"
for $table[1]».[*][0][*].comb(/'exp_lo='\d+/)».subst(/\D/, '',:g)
.trans([<0123456789>.comb] => [<⁰¹²³⁴⁵⁶⁷⁸⁹>.comb]).words;