What you call modlen[n,m] is the length of the continued fraction of m/n (perhaps +/- 1, I haven't checked). This has been studied a lot. For example there's a famous theorem of Heilbronn about the average length, which is referred to here http://matwbn.icm.edu.pl/ksiazki/aa/aa37/aa3717.pdf Victor On Fri, Apr 30, 2010 at 10:07 AM, Meeussen Wouter (bkarnd) < wouter.meeussen@vandemoortele.com> wrote:
for any number n and m<n, define the list m, Mod[n,m], Mod[n,Mod[n,m]], Mod[n,Mod[n,Mod[n,m]]], Mod[n,Mod[n,Mod[n,Mod[n,m]]]], .... stopping on Mod[n, 1 ]
as the iterated modulus list on n started from m. It has the property that it is a strictly decreasing list since Mod[n,m] < m. This descent can only proceed until Mod[n, 1 ] is reached.
Call the length of the resulting list modlen[n,m]
example: the iterated modulus list of n=1439 started from m=20 is
with length 12.
Now, look at the modlen(n,k) with k running from 1 up to n. Call it the "fullmodlist". This list (length n) is not symmetric, but it has :
n - 2 * S = 3 for n odd and n - 2 * S = 2 for n even
where S equals the sum over last half of fullmodlist(n) - first half of fullmodlist(n)
and that, I think, is curious.
Wouter.
-------------Mathematica---------------------------- mo[n_,m_]:= NestWhileList[Mod[n,#]&,m,#>1&] modlen[n_,m_]:=Length[NestWhileList[Mod[n,#]&,m,#>1&]]
Table[p=2n+1;it=modlen[p,#]&/@Range[p];p-2 Plus@ @Take[Reverse[it]-it,Floor[Length[it]/2]],{n,99}] Table[p=2n ;it=modlen[p,#]&/@Range[p];p-2 Plus@ @Take[Reverse[it]-it,Floor[Length[it]/2]],{n,99}]
=============================== This email is confidential and intended solely for the use of the individual to whom it is addressed. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. You are explicitly requested to notify the sender of this email that the intended recipient was not reached.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun