Page 1 of 1

how do I .... generate a "natural number"

Posted: Mon May 10, 2010 11:43 pm
by whakamaru
In a foot-note in the biography of Alan Turing, a natural number is describe as containing all the digits.
In 1962 I worked at a materials testing laboratory, we had one electro-mechanical calculator. Normally we would just use two decimal figures, but one day I let it go on clunking and chunking and noticed the answer was something like...
1357924680135 etc.
Alas, I have forgotten what the divisor was. I have looked. I have written down all the reciprocals of all the permutations of 13579 and 24680 and looked for suitable divisors. No joy. Perhaps the answer was something like... 6801357902468013579 ..etc
I tried to write an ASM program that would divide 10,000 by every number from 1,001 to 9,999, work it out to 15 decimal places and then search for 13579. No joy. (wrong code?...possibly)
I have looked at pages about math and interesting numbers. I would have thought that such a divider was an interesting number?
Not suitable for PE, since I can't give the answer?

Re: how do I .... generate a "natural number"

Posted: Mon May 10, 2010 11:58 pm
by whakamaru
Sorry, that should be "normal number". (ASM = "Another Senior Moment"!?)

Re: how do I .... generate a "natural number"

Posted: Tue May 11, 2010 3:25 am
by rayfil
The only way to get that string is:
(2*2*2*5*7*19*79*359) / (11*41*271*9091)

or any common multiple of the above, or in combination with a multiple of 10 of either one.
You would notice that (2*2*2*5*7*19*79*359)*9 = 1357924680
and (11*41*271*9091)*9 = 9999999999

Re: how do I .... generate a "natural number"

Posted: Thu May 13, 2010 9:25 pm
by wrongrook
Hi,

I'm not sure I have really understood your question, but you may also be interested in investigating numbers such as:
679/500005 = 0.001357986420135... or
13580/100001 = 0.1357986420135....

It is straightforward to generate such numbers by using continued fractions.


(Python code)

Code: Select all

import fractions
from decimal import Decimal
def contfrac(a,num):
   if a==0 or num==0: return fractions.Fraction(0)
   a=1/a
   b=int(a)
   return 1/(b+contfrac(a-b,num-1))
print contfrac(Decimal('0.'+'1357986420'*4),9)