Skip to content

Instantly share code, notes, and snippets.

@grondilu
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grondilu/f64589d8110917751695 to your computer and use it in GitHub Desktop.
Save grondilu/f64589d8110917751695 to your computer and use it in GitHub Desktop.
ludic numbers with lazy splicing
sub lazy-splice(@list, @splice) {
gather { take @list[$_] for @splice }
}
constant ludic = 1, gather {
my @candidates := 2 .. *;
loop {
take my $ludic = @candidates[0];
@candidates := lazy-splice(
@candidates,
grep * % $ludic, 1 .. *
);
}
}
say ludic[^25];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment