Pairs with common factors: Difference between revisions
m
→{{header|Raku}}: if we aren't reifying, pointless to have the intermediates
Thundergnat (talk | contribs) m (extend stretch goal) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: if we aren't reifying, pointless to have the intermediates) |
||
Line 56:
sub pair-count (\n) { n × (n - 1) / 2 + 1 - sum (1..n).map: { 𝜑[$_] } }
say "Number of pairs with common factors - first one hundred terms:\n"
~
for ^7 { say (my $i = 10 ** $_).&ordinal.tc.fmt("%22s term: ") ~ $i.&pair-count.&comma }</lang>
|