Post Reply 
(50g) Fun with Farey sequences
06-15-2015, 08:37 PM (This post was last modified: 06-15-2015 08:40 PM by Tugdual.)
Post: #1
(50g) Fun with Farey sequences
A video to start with.
A wikipedia page for the algorithm.
And some code for the 50g
%%HP: T(3)A(R)F(,);
\<< 0 1 1 0 1 \-> N A B C D nb
  \<< N 'D' STO A B /
    WHILE C N <
    REPEAT 'nb' INCR DROP N B + D / IP R\->I DUP C * A - SWAP D * B - C 'A' STO D 'B' STO 'D' STO 'C' STO A B /
    END nb \->LIST
Usage: enter order N and call the function; returns list of items for the Farey sequence order N.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
(50g) Fun with Farey sequences - Tugdual - 06-15-2015 08:37 PM

User(s) browsing this thread: 1 Guest(s)