<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>fareylen</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="expsegr.html" title="expsegr" /> <link rel="next" href="fareyleni.html" title="fareyleni" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">fareylen</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="expsegr.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="fareyleni.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="fareylen"> <a id="fareylen"></a> <div class="titlepage"></div> <a id="IndexFareylen" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">fareylen</span> </h2> <p>fareylen — returns the length of a Farey Sequence. </p> </div> <div class="refsect1" title="Description"> <a id="id2843801"></a> <h2>Description</h2> <p> This opcode can be used in conjunction with <a class="link" href="GENfarey.html" title="GENfarey"><em class="citetitle">GENfarey</em></a>. It calculates the length of Farey Sequence F<sub>n</sub>. Its length is given by: |F<sub>n</sub>| = 1 + SUM over n phi(m) where phi(m) is Euler's totient function, which gives the number of integers ≤ m that are coprime to m. </p> <p> Some values for the length of F<sub>n</sub> given n: </p> <div class="itemizedlist"> <ul class="itemizedlist" type="disc"> <li class="listitem">n |F<sub>n</sub>|</li> <li class="listitem">1 2</li> <li class="listitem">2 3</li> <li class="listitem">3 5</li> <li class="listitem">4 7</li> <li class="listitem">5 11</li> <li class="listitem">6 13</li> <li class="listitem">7 19</li> <li class="listitem">8 23</li> <li class="listitem">9 29</li> <li class="listitem">10 33</li> <li class="listitem">11 43</li> <li class="listitem">12 47</li> <li class="listitem">13 59</li> <li class="listitem">14 65</li> <li class="listitem">15 73</li> <li class="listitem">16 81</li> <li class="listitem">17 97</li> <li class="listitem">18 103</li> <li class="listitem">19 121</li> </ul> </div> <p> </p> </div> <div class="refsect1" title="Syntax"> <a id="id2845358"></a> <h2>Syntax</h2> <pre class="synopsis">kfl <span class="command"><strong>fareylen</strong></span> kfn</pre> </div> <div class="refsect1" title="Performance"> <a id="id2845377"></a> <h2>Performance</h2> <p> The length of the identified Farey sequence is returned. </p> <p> <span class="emphasis"><em>kfn</em></span> -- Integer identifying the sequence. </p> </div> <div class="refsect1" title="Credits"> <a id="id2845398"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Author: Georg Boenn </td> </tr> <tr> <td>University of Glamorgan, UK</td> </tr> </table> <p> </p> <p>New in Csound version 5.13</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="expsegr.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="fareyleni.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">expsegr </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> fareyleni</td> </tr> </table> </div> </body> </html>