[math-fun] The binom(n-r,r) remark in Adam's
https://cp4space.wordpress.com/2013/10/24/enumerating-the-rationals/ means that the familiar fractal pattern of Pascal's Triangle mod 2 gosper.org/fusc.png enumerates the rationals! I.e., the column sums of the latter two figures give Dÿkstra's fusc: In[140]:= Table[Sum[Binomial[n - r, r], {r, 0, n}], {n, 0, 17}] Out[140]= {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584} In[139]:= Table[Sum[Mod[Binomial[n - r, r], 2], {r, 0, n}], {n, 0, 17}] Out[139]= {1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4} In[137]:= Ratios[%] Out[137]= {1, 2, 1/2, 3, 2/3, 3/2, 1/3, 4, 3/4, 5/3, 2/5, 5/2, 3/5, 4/3, 1/4, 5, 4/5} Among all the remarkable properties of Pascal's Triangle, I rank this near the top. Adam's page mentions Newnham. Would that be the famous Alfred E, or is it simply Adam's Anglocentric spelling corrector? Forgetting I had NeilB's Calkin-Wilf accelerator, I foolishly tried to count down 325/36 by reverse Newman: x -> 2 ceiling(x) - x - 1. Hours later, I thought to In[118]:= ContinuedFraction[325/36] Out[118]= {9, 36} In[130]:= fromcf[{9, k}] Out[130]= (1 + 9 k)/k In[131]:= Table[%, {k, 11}] Out[131]= {10, 19/2, 28/3, 37/4, 46/5, 55/6, 64/7, 73/8, 82/9, 91/10, 100/11} In[136]:= noomct /@ %131 Out[136]= {1023, 1535, 2559, 4607, 8703, 16895, 33279, 66047, 131583, 262655, 524799} In[133]:= FindSequenceFunction[%, k] Out[133]= 511 + 2^(8 + k) In[134]:= 9 + 1/36 Out[134]= 325/36 In[135]:= %% /. k -> 36 Out[135]= 17592186044927 promising a rather lengthy wait. It is amazing how relatively congenial Newman is to convergents. Even for sqrt 7, which has period 4: In[259]:= Convergents[Sqrt[7], 16] Out[259]= {2, 3, 5/2, 8/3, 37/14, 45/17, 82/31, 127/48, 590/223, 717/271, 1307/494, 2024/765, 9403/3554, 11427/4319, 20830/7873, 32257/12192} In[260]:= tim[noomct[#]] & /@ % During evaluation of In[260]:= 0.000038,0 . . . During evaluation of In[260]:= 24.287843,0 During evaluation of In[260]:= 60.010885,0 Out[260]= {3, 7, 11, 27, 491, 1003, 1515, 3563, 62955, 128491, 194027, 456171, 8058347, 16446955, 24835563, 58389995} It can do 32257/12192, but not 325/36. FindSequenceFunction readily but messily interlaces the four sequences: In[261]:= FullSimplify[FindSequenceFunction[%, n], n \[Element] Integers] Out[261]= (1/4064)(-3424 + 2^(7 n/4) (221 + 976 2^(1/4) + 498 Sqrt[2] + 188 2^(3/4) + (-1)^ n (221 - 976 2^(1/4) + 498 Sqrt[2] - 188 2^(3/4)) + (442 - 996 Sqrt[2]) Cos[(n \[Pi])/2] + 8 2^(1/4) (244 - 47 Sqrt[2]) Sin[(n \[Pi])/2])) In[262]:= Table[%, {n, 16, 18}] // Simplify Out[262]= {58389995, 1031468523, 2105210347} In[263]:= Convergents[Sqrt[7], 18][[-3 ;; -1]] Out[263]= {32257/12192, 149858/56641, 182115/68833} In[264]:= tim[noomct[#]] & /@ Rest[%] During evaluation of In[264]:= 1050.500020,0 During evaluation of In[264]:= 2107.729563,0 Out[264]= {1031468523, 2105210347} as predicted. --rwg
Corrigendum: Reverse Newman: 2*ceiling(1/x) -1/x - 1 , E.g. In[272]:= NestWhileList[2*Ceiling[1/#] - 1/# - 1 &, 3/5, # > 0 &] Out[272]= {3/5, 4/3, 1/4, 3, 2/3, 3/2, 1/3, 2, 1/2, 1, 0} Omitendum: fusc: A002487 <http://oeis.org/A002487> Apologies. --rwg
Omitendum: Omitendum. Substituendum: Memorandum. --rwdumdum On Mon, May 26, 2014 at 10:15 AM, Bill Gosper <billgosper@gmail.com> wrote:
Corrigendum: Reverse Newman: 2*ceiling(1/x) -1/x - 1 , E.g. In[272]:= NestWhileList[2*Ceiling[1/#] - 1/# - 1 &, 3/5, # > 0 &]
Out[272]= {3/5, 4/3, 1/4, 3, 2/3, 3/2, 1/3, 2, 1/2, 1, 0}
Omitendum: fusc: A002487 <http://oeis.org/A002487> Apologies. --rwg
http://oeis.org/A002487 mentions
It appears that the terms of this sequence are the number of odd entries in the diagonals of Pascal's triangle at 45 degrees slope. - Javier Torres (adaycalledzero(AT)hotmail.com), Aug 06 2009
A consequence is that the parity of Fusc(n) is the same as Fib(n), which has period 3: odd, odd, even, ... This suggests looking at other moduli, such as Fusc(n) mod 3, and also looking at other bits of Fusc(n) beyond the low order bit. Rich ------- Quoting Bill Gosper <billgosper@gmail.com>:
https://cp4space.wordpress.com/2013/10/24/enumerating-the-rationals/ means that the familiar fractal pattern of Pascal's Triangle mod 2 gosper.org/fusc.png enumerates the rationals! I.e., the column sums of the latter two figures give Dÿkstra's fusc: In[140]:= Table[Sum[Binomial[n - r, r], {r, 0, n}], {n, 0, 17}]
Out[140]= {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584}
In[139]:= Table[Sum[Mod[Binomial[n - r, r], 2], {r, 0, n}], {n, 0, 17}]
Out[139]= {1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4}
In[137]:= Ratios[%]
Out[137]= {1, 2, 1/2, 3, 2/3, 3/2, 1/3, 4, 3/4, 5/3, 2/5, 5/2, 3/5, 4/3, 1/4, 5, 4/5}
Among all the remarkable properties of Pascal's Triangle, I rank this near the top.
Adam's page mentions Newnham. Would that be the famous Alfred E, or is it simply Adam's Anglocentric spelling corrector?
Forgetting I had NeilB's Calkin-Wilf accelerator, I foolishly tried to count down 325/36 by reverse Newman: x -> 2 ceiling(x) - x - 1. Hours later, I thought to
In[118]:= ContinuedFraction[325/36]
Out[118]= {9, 36}
In[130]:= fromcf[{9, k}]
Out[130]= (1 + 9 k)/k
In[131]:= Table[%, {k, 11}]
Out[131]= {10, 19/2, 28/3, 37/4, 46/5, 55/6, 64/7, 73/8, 82/9, 91/10, 100/11}
In[136]:= noomct /@ %131
Out[136]= {1023, 1535, 2559, 4607, 8703, 16895, 33279, 66047, 131583, 262655, 524799}
In[133]:= FindSequenceFunction[%, k]
Out[133]= 511 + 2^(8 + k)
In[134]:= 9 + 1/36
Out[134]= 325/36
In[135]:= %% /. k -> 36
Out[135]= 17592186044927
promising a rather lengthy wait.
It is amazing how relatively congenial Newman is to convergents. Even for sqrt 7, which has period 4: In[259]:= Convergents[Sqrt[7], 16]
Out[259]= {2, 3, 5/2, 8/3, 37/14, 45/17, 82/31, 127/48, 590/223, 717/271, 1307/494, 2024/765, 9403/3554, 11427/4319, 20830/7873, 32257/12192}
In[260]:= tim[noomct[#]] & /@ %
During evaluation of In[260]:= 0.000038,0 . . .
During evaluation of In[260]:= 24.287843,0
During evaluation of In[260]:= 60.010885,0
Out[260]= {3, 7, 11, 27, 491, 1003, 1515, 3563, 62955, 128491, 194027, 456171, 8058347, 16446955, 24835563, 58389995}
It can do 32257/12192, but not 325/36. FindSequenceFunction readily but messily interlaces the four sequences:
In[261]:= FullSimplify[FindSequenceFunction[%, n], n \[Element] Integers]
Out[261]= (1/4064)(-3424 + 2^(7 n/4) (221 + 976 2^(1/4) + 498 Sqrt[2] + 188 2^(3/4) + (-1)^ n (221 - 976 2^(1/4) + 498 Sqrt[2] - 188 2^(3/4)) + (442 - 996 Sqrt[2]) Cos[(n \[Pi])/2] + 8 2^(1/4) (244 - 47 Sqrt[2]) Sin[(n \[Pi])/2]))
In[262]:= Table[%, {n, 16, 18}] // Simplify
Out[262]= {58389995, 1031468523, 2105210347}
In[263]:= Convergents[Sqrt[7], 18][[-3 ;; -1]]
Out[263]= {32257/12192, 149858/56641, 182115/68833}
In[264]:= tim[noomct[#]] & /@ Rest[%]
During evaluation of In[264]:= 1050.500020,0
During evaluation of In[264]:= 2107.729563,0
Out[264]= {1031468523, 2105210347} as predicted. --rwg _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (2)
-
Bill Gosper -
rcs@xmission.com