September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
11
Task/Stern-Brocot-sequence/Zkl/stern-brocot-sequence.zkl
Normal file
11
Task/Stern-Brocot-sequence/Zkl/stern-brocot-sequence.zkl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fcn SB // Stern-Brocot sequence factory --> Walker
|
||||
{ Walker(fcn(sb,n){ a,b:=sb; sb.append(a+b,b); sb.del(0); a }.fp(L(1,1))) }
|
||||
|
||||
SB().walk(15).println();
|
||||
|
||||
[1..10].zipWith('wrap(n){ [1..].zip(SB())
|
||||
.filter(1,fcn(n,sb){ n==sb[1] }.fp(n)) })
|
||||
.walk().println();
|
||||
[1..].zip(SB()).filter1(fcn(sb){ 100==sb[1] }).println();
|
||||
|
||||
sb:=SB(); do(500){ if(sb.next().gcd(sb.next())!=1) println("Oops") }
|
||||
Loading…
Add table
Add a link
Reference in a new issue