Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub MAIN(Int $initial #= initial number
- ){
- my $condition = $initial>0 ?? 1 !! -1|-5|-17;
- my \seq = $initial, -> $n {$n %% 2 ?? $n/2 !! 3*$n+1} ... * == $condition;
- for seq -> $x { say $x;};
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement