Re: [math-fun] exact inches per meter
David Wilson>Also related and interesting is 499999 = 31 x 127^2 ----------------- In[209]:= RealDigits[1/499999] Out[209]= A very large output was generated. Here is a sample of it: {{{2,0,0,0,0,0,4,0,0,0,0,0,8,0,0,0,0,1,6,0,0,0,0,3,2,0,0,0,0,6,4,0,0,0,1,2,8,0,0,0,2,5, <<26587>>, 5,1,5,6,2,5,0,3,1,2,5,0,0,6,2,5,0,0,1,2,5,0,0,0,2,5,0,0,0,0,5,0,0,0,0,1,0,0,0,0,0}},<<1>>} In[213]:= Length[%209[[1,1]]] Out[213]= 26670 In[214]:= %209[[2]] Out[214]= -5 It "abbreviated" -5 to <<1>> !! In[212]:= Length[RealDigits[1/499999,2][[1,1]]] Out[212]= 4445 I would have expected shorter periods. --rwg -----Original Message----- From: math-fun-bounces@mailman.xmission.com [mailto:math-fun- bounces@mailman.xmission.com] On Behalf Of Bill Gosper Sent: Thursday, May 23, 2013 4:55 PM To: math-fun@mailman.xmission.com Subject: [math-fun] exact inches per meter has a long repeating decimal: In[170]:= RealDigits[100/(254/100)] Out[170]= {{{3, 9, 3, 7, 0, 0, 7, 8, 7, 4, 0, 1, 5, 7, 4, 8, 0, 3, 1, 4, 9, 6, 0, 6, 2, 9, 9, 2, 1, 2, 5, 9, 8, 4, 2, 5, 1, 9, 6, 8, 5, 0}}, 2} I.e. 39.3700... But the binary is very short: In[171]:= RealDigits[100/(254/100), 2] Out[171]= {{1, 0, 0, {1, 1, 1, 0, 1, 0, 1}}, 6} i.e. 100111.0101... Likewise the octal: In[172]:= RealDigits[100/(254/100), 8] Out[172]= {{4, {7, 2, 7, 5, 3, 6, 5}}, 2} Reason: 254 = 2*(2^7 - 1) . --rwg
Bill Gosper:
In[209]:= RealDigits[1/499999] Out[209]= A very large output was generated. Here is a sample of it: {{{2,0,0,0,0,0,4,0,0,0,0,0,8,0,0,0,0,1,6,0,0,0,0,3,2,0,0,0,0,6,4,0,0,0,1,2,8,0,0,0,2,5, <<26587>>, 5,1,5,6,2,5,0,3,1,2,5,0,0,6,2,5,0,0,1,2,5,0,0,0,2,5,0,0,0,0,5,0,0,0,0,1,0,0,0,0,0}},<<1>>}
Mathematica 9 just gives: A very large output was generated. Here is a sample of it: <<1>>
I would have expected shorter periods.
I wanted to chart the period lengths for numbers of the form 49..9: Do[Print[Length[RealDigits[1/(10^n/2-1)][[1,1]]]],{n,2,16}] 42 498 357 641 26670 2499999 10248414 27737540 7001968 $Aborted This is better: Do[Print[MultiplicativeOrder[10,10^n/2-1]],{n,2,32}] 42 498 357 641 26670 2499999 10248414 27737540 7001968 24137931020 6247894877 2494908350060 7142857142856 249999999999999 1127586401304 7894736842105260 4671128568960 2448870123624540 7086158741278272 12095429958167388195 312056003600817627576 8668466022247153980 83333333331328827277944 81920903027779372603690 2521008403361344537815120 11523500839479696018300 1249999999999734482100644020 51349764590147678308496080 810869311801162457543134512 2288713183042871537476080 7142857142857142857142857142856
In general, regardless of base, the period of 1/n divides phi(n). So perhaps it would be interesting to provide phi(n)/period. On Sat, May 25, 2013 at 6:32 PM, Hans Havermann <gladhobo@teksavvy.com>wrote:
Bill Gosper:
In[209]:= RealDigits[1/499999] Out[209]= A very large output was generated. Here is a sample of it:
{{{2,0,0,0,0,0,4,0,0,0,0,0,8,0,0,0,0,1,6,0,0,0,0,3,2,0,0,0,0,6,4,0,0,0,1,2,8,0,0,0,2,5,
<<26587>>,
5,1,5,6,2,5,0,3,1,2,5,0,0,6,2,5,0,0,1,2,5,0,0,0,2,5,0,0,0,0,5,0,0,0,0,1,0,0,0,0,0}},<<1>>}
Mathematica 9 just gives:
A very large output was generated. Here is a sample of it: <<1>>
I would have expected shorter periods.
I wanted to chart the period lengths for numbers of the form 49..9:
Do[Print[Length[RealDigits[1/(10^n/2-1)][[1,1]]]],{n,2,16}] 42 498 357 641 26670 2499999 10248414 27737540 7001968 $Aborted
This is better:
Do[Print[MultiplicativeOrder[10,10^n/2-1]],{n,2,32}] 42 498 357 641 26670 2499999 10248414 27737540 7001968 24137931020 6247894877 2494908350060 7142857142856 249999999999999 1127586401304 7894736842105260 4671128568960 2448870123624540 7086158741278272 12095429958167388195 312056003600817627576 8668466022247153980 83333333331328827277944 81920903027779372603690 2521008403361344537815120 11523500839479696018300 1249999999999734482100644020 51349764590147678308496080 810869311801162457543134512 2288713183042871537476080 7142857142857142857142857142856 _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (3)
-
Allan Wechsler -
Bill Gosper -
Hans Havermann