flat assembler
Message board for the users of flat assembler.

 Index > Heap > Numerical oddities Goto page Previous  1, 2, 3, 4 ... 24, 25, 26  Next
Author
Tomasz Grysztar
Assembly Artist

Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
0.(012345679)=012345679/999999999

12345679=37*333667
999999999=(3^4)*37*333667

12345679/999999999=1/(3^4)=1/81

In general, for base b, the value 0.(a1_a2_..._an) is equal to fraction a1_a2_..._an/(b-1)_(b-1)_...(b-1)
(with n (b-1) digits in the denominator).

How does it work? Let x=(b-1)_(b-1)_..._(b-1) (n digits), and see what the 1/x value is:
1/x=(x+1)/x(x+1)=1/(x+1) + [1/(x+1)]*[1/x]
Since 1/(x+1) is 0.00...1 (digit 1 is on nth position), the first n digits after 0 of 1/x are 00...1, and by recursion we get that 1/x=0.(00..1)
28 Sep 2008, 10:16
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
Very fast, very good, you win the small prize of one star.

*

The prize was mentioned in the initial post asking the question, but you have to use the "quote" button (or "edit" button if you are a mod) to see it.
28 Sep 2008, 12:51
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
Hmm, does it work in phinary (base φ)?
28 Sep 2008, 13:07
Borsuc

Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
revolution wrote:
The prize was mentioned in the initial post asking the question, but you have to use the "quote" button (or "edit" button if you are a mod) to see it.

_________________
Previously known as The_Grey_Beast
29 Sep 2008, 16:57
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
Show either of the following (only one can be true):
1. Give a number that uses all 10 decimal digits (0 through 9) once only, in any order, that forms a prime number, or
2. Prove that there is no such way to form a prime number with those digits no matter which order your choose.
There will be a small prize of one star to the first person to give the correct answer.
16 Oct 2008, 16:30
windwakr

Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
EDIT2: I'll stand with what I first said

From wiki's page on pandigital nubmers:

Quote:

No base 10 pandigital number can be a prime number if it doesn't have redundant digits. The sum of the digits 0 to 9 is 45, passing the test for divisibility for both 3 and 9. The first base 10 pandigital prime is 10123457689

Loco, heres a quote from some other website,

Quote:

Divisible by 3 or 9?

Many people know this one: to determine whether a number is divisible by 3, add up the digits in the number. If the result is divisible by 3, then the original number is divisible by 3 too. You can use this as a quick way to show that the number mentioned above is not divisible by 3.

The added together thing is only to test for division by 3 and 9

Thus, any number using 0-9 only once is divisible by 3 and not prime.

_________________
----> * <---- My star, won HERE

Last edited by windwakr on 16 Oct 2008, 19:46; edited 8 times in total
16 Oct 2008, 18:48
LocoDelAssembly

Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Are you honestly convinced of that? How is possible that you are not convinced about 0.(9) = 1 then?

31 is prime, a Mersenne prime, but the sum of both digits is 4, a composite number, so why summing from 0 to 9 is enough proof of the non existence of a base 10 pandigital with non redundant digits prime number?
16 Oct 2008, 19:09
LocoDelAssembly

Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Great! Seems that you won the small price then, congratulations

Here I found the proof
http://technocosm.org/chaos/divisibility.html wrote:
Divisibility by 3
A number is evenly divisible by 3 if the sum of all its digits is evenly divisible by 3.

Why?
Consider a 2 digit number 10*a + b = 9*a + (a+b).

We know that 9*a is divisible by 3, so 10*a + b will be divisible by 3 if and only if a+b is.

Similarly, 100*a + 10*b + c = 99*a + 9*b + (a + b + c), and 99*a + 9*b is divisible by 3, so the total will be divisible by 3 if and only if a + b + c is.

This explanation also works to prove the divisibility by 9 test.
16 Oct 2008, 19:28
Tomasz Grysztar
Assembly Artist

Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
That page lacks the explanation for the rule for divisibility by 11, but it can be done with the very same trick. For example:

1000*a+100*b+10*c+d=1001*a+99*b+11*c+(d-c+b-a)

The number that consists of even count of 9 digits (let's call it "form *") is divisible by 11, because it is 9*11+9*11*100+etc.

The number that is equal to an odd power of 10 plus 1, is equal to 11 plus number, which is "form *" multiplied by 10. For instance 1001=99*10+11.
16 Oct 2008, 20:41
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
So far no one has been able to prove that a 10 digit pandigital number cannot be prime, and no one has provided a counter example. The competition is still open.

Proof that a two or three digit number (from LocoDelAssembly) is divisible by three has not been shown to extend to 10 digits. Perhaps induction might help here?
16 Oct 2008, 23:25
windwakr

Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
You looking for something like this?
Quote:

1000000000*a + 100000000*b + 10000000*c + 1000000*d + 100000*e + 10000*f + 1000*g + 100*h + 10*i + j
=
999999999*a + 99999999*b + 9999999*c + 999999*d + 99999*e + 9999*f + 999*g + 99*h + 9*i + (a+b+c+d+e+f+g+h+i+j)

_________________
----> * <---- My star, won HERE
17 Oct 2008, 00:29
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
windwakr: If you keep up with that sort of posting then you might just win the prize.

Can you complete the proof?

BTW: I would have also accepted a small program that generates all the permutations and tests each for primality. Of course, we only need to do one trial division by three and check the remainder is zero. Quite trivial really.
17 Oct 2008, 00:51
windwakr

Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Quote:

1000000000*a + 100000000*b + 10000000*c + 1000000*d + 100000*e + 10000*f + 1000*g + 100*h + 10*i + j
=
999999999*a + 99999999*b + 9999999*c + 999999*d + 99999*e + 9999*f + 999*g + 99*h + 9*i + (a+b+c+d+e+f+g+h+i+j)

999999999*a + 99999999*b + 9999999*c + 999999*d + 99999*e + 9999*f + 999*g + 99*h + 9*i is divisible by 3, so the whole number is divisible by 3 only if (a+b+c+d+e+f+g+h+i+j) is.

Thus, any number having all 1234567890 and only once will always be divisible by 3, making it not prime.

1+2+3+4+5+6+7+8+9+0=45 divisible by both 3 and 9

is that what you want?

_________________
----> * <---- My star, won HERE
17 Oct 2008, 01:00
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
windwakr wins the prize:

*

Congratulations!

The prize of one star was listed in the very first posting that stated the problem (you have to see the hidden text with either the quote button or the copy and paste method), I hope you are happy with the prize and may it always bring you joy and happiness forever and ever.
17 Oct 2008, 01:18
windwakr

Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
windwakr
Wow, I can't believe that was right! Woooo, a star.....I'm gonna put it in my sig.

How do I make a link to a specific post in a thread?

_________________
----> * <---- My star, won HERE
17 Oct 2008, 01:25
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
windwakr wrote:
How do I make a link to a specific post in a thread?
Every post has a link in the left margin.

17 Oct 2008, 05:43
Tomasz Grysztar
Assembly Artist

Joined: 16 Jun 2003
Posts: 7718
Location: Kraków, Poland
Tomasz Grysztar
revolution: I believe windwakr really provided the proof (even though not his own) in his first post. It is based on well-known facts and complete in just one sentence.

Also how to proceed with induction is obvious from the thing that LocoDelAssembly provided, in math books this kind of showing the proof is also often and recognized.

Don't exagerrate with formalism - when you go into some serious mathematics with it, it's gonna kill you.
17 Oct 2008, 07:40
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17270
revolution
Tomasz Grysztar wrote:
revolution: I believe windwakr really provided the proof (even though not his own) in his first post. It is based on well-known facts and complete in just one sentence.

Also how to proceed with induction is obvious from the thing that LocoDelAssembly provided, in math books this kind of showing the proof is also often and recognized.
Okay, but the prize was so important that only requiring a one line answer would have been like a get out of jail free card. One must earn such prizes else they will seem to be of no consequence.
Tomasz Grysztar wrote:
Don't exagerrate with formalism - when you go into some serious mathematics with it, it's gonna kill you.
Hehe, your just jealous that you didn't win the prize, nyah-nyah nya nyah-nyah.

Actually I think you are correct,. You could easily kill me with some formal mathematics, I'm still just learning this stuff and never had any formal training. Maybe later I'll get around to solving the Riemann Hypothesis.
17 Oct 2008, 09:18
Pinecone_

Joined: 28 Apr 2008
Posts: 180
Pinecone_
lol this stuff kills me im only half way through year 11 math a - but at least im finding it easy
17 Oct 2008, 14:10
bitRAKE

Joined: 21 Jul 2003
Posts: 2913
Location: [RSP+8*5]
bitRAKE
revolution wrote:
BTW: I would have also accepted a small program that generates all the permutations and tests each for primality.
Project Euler has several pandigital problems:

32. Find the sum of all numbers that can be written as pandigital products.

38. What is the largest 1 to 9 pandigital that can be formed by multiplying a fixed number by 1, 2, 3, ... ?

41. What is the largest n-digit pandigital prime that exists?

43. Find the sum of all pandigital numbers with an unusual sub-string divisibility property.

104. Finding Fibonacci numbers for which the first and last nine digits are pandigital.

170. Find the largest 0 to 9 pandigital that can be formed by concatenating products.

It appears I have solved some of them (including #41), so I have some BCD code floating around with pandigital algorithms...(can't remember where though). Of the people using Assembler to solve the problems I've dropped to 6th place and I haven't solved a problem in 859 days, lol.

_________________
17 Oct 2008, 14:59
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area
Goto page Previous  1, 2, 3, 4 ... 24, 25, 26  Next

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum