Super-Poulet numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Raku}}: efficiency tweaks) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: overboard) |
||
Line 27: | Line 27: | ||
say "First 20 Super-Poulet numbers:\n" ~ @super-poulet[^20].gist; |
say "First 20 Super-Poulet numbers:\n" ~ @super-poulet[^20].gist; |
||
for 1e6.Int, 1e7.Int -> $threshold { |
|||
my $threshold = 1e6.Int; |
|||
say "\nIndex and value of first Super-Poulet greater than {$threshold.&cardinal}:"; |
say "\nIndex and value of first Super-Poulet greater than {$threshold.&cardinal}:"; |
||
my $index = @super-poulet.first: * > $threshold, :k; |
my $index = @super-poulet.first: * > $threshold, :k; |
||
say "{(1+$index).&ordinal-digit} Super-Poulet number == " ~ @super-poulet[$index]., |
say "{(1+$index).&ordinal-digit} Super-Poulet number == " ~ @super-poulet[$index]., |
||
}</lang> |
|||
{{out}} |
{{out}} |
||
<pre>First 20 Super-Poulet numbers: |
<pre>First 20 Super-Poulet numbers: |
||
Line 36: | Line 37: | ||
Index and value of first Super-Poulet greater than one million: |
Index and value of first Super-Poulet greater than one million: |
||
109th Super-Poulet number == 1,016,801 |
109th Super-Poulet number == 1,016,801 |
||
Index and value of first Super-Poulet greater than ten million: |
|||
317th Super-Poulet number == 10,031,653 |
|||
</pre> |