Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Arithmetic-Rational/Raku/arithmetic-rational-1.raku
Normal file
11
Task/Arithmetic-Rational/Raku/arithmetic-rational-1.raku
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(2..2**19).hyper.map: -> $candidate {
|
||||
my $sum = 1 / $candidate;
|
||||
for 2 .. ceiling(sqrt($candidate)) -> $factor {
|
||||
if $candidate %% $factor {
|
||||
$sum += 1 / $factor + 1 / ($candidate / $factor);
|
||||
}
|
||||
}
|
||||
if $sum.nude[1] == 1 {
|
||||
say "Sum of reciprocal factors of $candidate = $sum exactly", ($sum == 1 ?? ", perfect!" !! ".");
|
||||
}
|
||||
}
|
||||
1
Task/Arithmetic-Rational/Raku/arithmetic-rational-2.raku
Normal file
1
Task/Arithmetic-Rational/Raku/arithmetic-rational-2.raku
Normal file
|
|
@ -0,0 +1 @@
|
|||
for 1.0, 1.1, 1.2 ... 10 { .say }
|
||||
Loading…
Add table
Add a link
Reference in a new issue