aboutsummaryrefslogtreecommitdiff
path: root/challenge-104/arne-sommer/raku/fusc-seq
blob: e8639c698ffb119d8655493e6de90413f966ab70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /usr/bin/env raku

unit sub MAIN ($limit = 50);

my $fusc := gather
{
  take 0; 
  take 1;
  my $index = 1;
  loop
  {
    $index++;
    take $fusc[$index / 2];
    $index++;
    take $fusc[($index - 1)/2] + $fusc[($index +1)/2];
  }
}

say $fusc[^$limit].join(", ");