fork download
  1. #! /usr/bin/env perl6
  2.  
  3. # https://c...content-available-to-author-only...e.com/questions/82815/denominator-of-harmonic-series/82844#82844
  4.  
  5. my &hd = {([+] 1.FatRat X/1..$_).nude[1]}
  6.  
  7. .say for 1..10 Z=> (1..10)».&hd;
  8.  
  9. say '';
  10.  
  11. say 100 => hd 100;
  12.  
  13. say '';
  14.  
  15. say 1000 => hd 1000;
Success #stdin #stdout 3.27s 243072KB
stdin
Standard input is empty
stdout
1 => 1
2 => 2
3 => 6
4 => 12
5 => 60
6 => 20
7 => 140
8 => 280
9 => 2520
10 => 2520

100 => 2788815009188499086581352357412492142272

1000 => 7128865274665093053166384155714272920668358861885893040452001991154324087581111499476444151913871586911717817019575256512980264067621009251465871004305131072686268143200196609974862745937188343705015434452523739745298963145674982128236956232823794011068809262317708861979540791247754558049326475737829923352751796735248042463638051137034331214781746850878453485678021888075373249921995672056932029099390891687487672697950931603520000