#M , (削除) 9 (削除ここまで) 6 bytes
M , (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g1 # Compute the greatest common denominator with n. (1/27720 for n=12)
İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M , (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g1 # Compute the greatest common denominator with n. (1/27720 for n=12)
İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
M , (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g1 # Compute the greatest common denominator with n. (1/27720 for n=12)
İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M, (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g g1 # Compute the greatest common denominator with n. (1/27720 for n=12)
1İ İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M, (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g # Compute the greatest common denominator. (1/27720 for n=12)
1İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M, (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g1 # Compute the greatest common denominator with n. (1/27720 for n=12)
İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M, (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g # Compute the greatest common denominator. (1/27720 for n=12)
1İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M, (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV
#M, (削除) 9 (削除ここまで) 6 bytes
Thanks to FryAmTheEggman for saving 3 bytes! Code:
RİSg1İ
M has a huge advantage here, because it works with fractions rather than floats. Explanation:
R # Get the list [1 ... n].
İ # Inverse each, resulting into [1/1, 1/2, 1/3, ..., 1/n].
S # Sum it up. (86021/27720 for n=12)
g # Compute the greatest common denominator. (1/27720 for n=12)
1İ # Calculate the inverse again. (27720 for n=12)
Uses the Jelly encoding. Try it online!.
Also, there is a 4-byte solution, which outputs a leading zero sometimes (e.g. 280 -> 0280). I'm not sure if this is allowed or not:
RİSV