September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,12 +1,11 @@
constant Stern-Brocot = flat
1, 1, -> *@a {
@a[$_ - 1] + @a[$_], @a[$_] given ++$;
} ... *;
say Stern-Brocot[^15];
for 1 .. 10, 100 -> $ix {
say "first occurrence of $ix is at index : ", 1 + Stern-Brocot.first($ix, :k);
constant @Stern-Brocot = 1, 1, {
|(@_[$_ - 1] + @_[$_], @_[$_]) given ++$
} ... *;
 
say @Stern-Brocot[^15];
 
for (flat 1..10, 100) -> $ix {
say "first occurrence of $ix is at index : ", 1 + @Stern-Brocot.first($ix, :k);
}
say so 1 == all map ^1000: { [gcd] Stern-Brocot[$_, $_ + 1] }
 
say so 1 == all map ^1000: { [gcd] @Stern-Brocot[$_, $_ + 1] }