flat assembler
Message board for the users of flat assembler.

flat assembler > Heap > Numerical oddities

Goto page Previous  1, 2, 3, 4 ... 24, 25, 26  Next
Author
Thread Post new topic Reply to topic
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7373
Location: Kraków, Poland
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)
Post 28 Sep 2008, 10:16
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
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.
Post 28 Sep 2008, 12:51
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
Hmm, does it work in phinary (base φ)?
Post 28 Sep 2008, 13:07
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
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.
Or copy-paste it to Notepad Razz

_________________
Previously known as The_Grey_Beast
Post 29 Sep 2008, 16:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
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.
Post 16 Oct 2008, 16:30
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
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
Post 16 Oct 2008, 18:48
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


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

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?
Post 16 Oct 2008, 19:09
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


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

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.
Post 16 Oct 2008, 19:28
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7373
Location: Kraków, Poland
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.
Post 16 Oct 2008, 20:41
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
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?
Post 16 Oct 2008, 23:25
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
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
Post 17 Oct 2008, 00:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
windwakr: If you keep up with that sort of posting then you might just win the prize. Wink

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.
Post 17 Oct 2008, 00:51
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
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
Post 17 Oct 2008, 01:00
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
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.
Post 17 Oct 2008, 01:18
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
Location: Michigan, USA
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
Post 17 Oct 2008, 01:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
windwakr wrote:
How do I make a link to a specific post in a thread?
Every post has a link in the left margin.


Description: Click here to jump to the post.
Filesize: 2.04 KB
Viewed: 13856 Time(s)

SpecificLinkToAPost.PNG


Post 17 Oct 2008, 05:43
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7373
Location: Kraków, Poland
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. Wink
Post 17 Oct 2008, 07:40
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16792
Location: In your JS exploiting you and your system
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. Wink
Hehe, your just jealous that you didn't win the prize, nyah-nyah nya nyah-nyah. Razz

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.
Post 17 Oct 2008, 09:18
View user's profile Send private message Visit poster's website Reply with quote
Pinecone_



Joined: 28 Apr 2008
Posts: 180
lol this stuff kills me Razz im only half way through year 11 math a - but at least im finding it easy
Post 17 Oct 2008, 14:10
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2796
Location: dank orb
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.

_________________
¯\(°_o)/¯ unlicense.org
Post 17 Oct 2008, 14:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4 ... 24, 25, 26  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.