mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2003-06-18, 16:26   #23
epatka
 
Jun 2003

25 Posts
Default

Quote:
I hope your number is prime :D
Thanks, Jeff :D
epatka is offline   Reply With Quote
Old 2003-06-18, 16:41   #24
epatka
 
Jun 2003

1000002 Posts
Default Re: A strange idea......

Quote:
Just trying to put you at ease. :)
It worked :) Just the fact that what I discovered wasn't yesterday's news makes me feel less foolish.....

Quote:
Mathematicians have come up with ways to multiply and divide large numbers that are much, much faster than the methods we all learned in school.
But it's always possible to find a number large enough to make arithmetic as big a task as you want.
In this case I guess it would be a big task....... I keep hearing how many million or billion functions a second. It is very hard to imagine what is a bigger task? To do millions of factors a second or to make one division of a 10 million digit number.

Quote:
That's the point where you've found the k for this p !! When the remainder is 1, you've found the k such that 10^k-1 is divisible by p.
Thanks. I realized that. Even if this whole thing was in vain, I learned a lot about how numbers work. I was pretty lazy in school.


Quote:
Well, since division is the inverse of multiplication, it seems likely that any statement or theorem about prime integers has a corresponding statement or theorem about the inverses of primes
.

You mean, they must have covered this subject? But I think that because this is almost an "invisible" part of math, people might overlook the importance of it. Besides, when we work with primes, the sky is the limit. This way, I can "tame" them a bit, and observe how they behave under certain circumstances. I might be wrong, but I think that this way there is hope to discover something about them that might help to recognize them...... In case I am not making sense, I don't blame you. Sometimes I don't make sense to myself ;)

By the way, I am glad at least a few people are interested in this.

Eva
epatka is offline   Reply With Quote
Old 2003-06-18, 20:57   #25
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

11110000011002 Posts
Default Re: A strange idea......

Quote:
Originally Posted by epatka
Quote:
Well, since division is the inverse of multiplication, it seems likely that any statement or theorem about prime integers has a corresponding statement or theorem about the inverses of primes
.
You mean, they must have covered this subject?
No, I meant that it seems likely that the corresponding statements or theorems exist or could be formulated even if no one has yet actually recognized, studied or published them.

However, it could be that almost every theorem about integers has already had its corresponding theorem about inverses recognized, but the "inverse" theorem may just not have interested many people beyond the first to study it.

As ads for the Public Proadcasting System here say -- "Stay curious."
cheesehead is offline   Reply With Quote
Old 2003-06-20, 00:49   #26
epatka
 
Jun 2003

3210 Posts
Default Re: A strange idea......

Quote:
No, I meant that it seems likely that the corresponding statements or theorems exist or could be formulated even if no one has yet actually recognized, studied or published them.
True.

Quote:
However, it could be that almost every theorem about integers has already had its corresponding theorem about inverses recognized, but the "inverse" theorem may just not have interested many people beyond the first to study it.
Maybe nobody has thought of a way of using it. I have a feeling that there is a lot to discover here. It is fascinating that the inverses have their own rules of addition, multiplication, etc.

I was hoping they could be used to find prime numbers, but no luck :(
epatka is offline   Reply With Quote
Old 2003-06-21, 00:35   #27
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

2×137 Posts
Default

Quote:
Originally Posted by epatka
Maybe nobody has thought of a way of using it. I have a feeling that there is a lot to discover here. It is fascinating that the inverses have their own rules of addition, multiplication, etc.

I was hoping they could be used to find prime numbers, but no luck :(
Perhaps we are thinking in the wrong base.
If noting that 1/7 = 0.142857 142857... base 10 implies that 7 | 10^6 - 1 implies 7 | 10^3 + 1.
Then noting that 1/111 = 0.001 001... base 2 implies that 7 | 2^3-1, right?
[code:1]Inv. repeat order
1/3 = 01 2 3/ 3 = 1
1/5 = 0011 4 15/ 5 = 3
1/7 = 001 3 7/ 7 = 1
1/9 = 000111 6 63/ 9 = 7
1/11 = 0001011101 10 1023/11 = 93
[/code:1]
If we consider primes only, or even primes == +-1 (mod 8 ), this is another way to look for factors of mersenne numbers.
[code:1] 1/p repeating binary fraction order M(order)/p
1/3 01 2 3/ 3 = 1
1/7 001 3 7/ 7 = 1
1/17 00001111 8 255/17 = 15
1/23 00001011001 11 2047/23 = 89
1/31 00001 5 31/31 = 1
1/41 00000110001111100111 20 1048575/41 = 25575
1/47 00000101011100100110001 23 8388607/47 = 178481
1/71 00000011100110110000101011010001001 35 34359738367/71 = 483939977
1/73 000000111 9 511/73 = 7
1/79 000000110011110110010001110100101010001 39 549755813887/79 = 6958934353
1/89 00000010111 11 2047/89 = 23
1/97 000000101010001110100000111111010101110001011111 48 281474976710655/97 = 2901803883615
[/code:1]
The code to calculate 1/p base 2 isn't too ugly.
[code:1]
for(binary="",skip=2,work=2; work>0; ) {
while (n>work) { work *= 2; binary += "0"; }
work -= n;
binary += "1";
if (work==1) work = 0; // fraction starts repeating.
work *= 2;
// if work = 2^k for the second time then fraction also repeats.
for(check=work; check%2==0; check/=2);
if (check==1 && --skip==0) work = 0;
}
m = length of binary --> n | 2^m - 1.
[/code:1]
If strings were used instead of integers the code would be faster and would work for big numbers.

So how does this compare to the power mod method?
EDIT: Oh, right: n shifts + subtractions vs. log2(n) squares + doubles. :( :( sigh :( :( /EDIT

Any other uses for this in base 2? Other bases?

Maybeso
Maybeso is offline   Reply With Quote
Old 2003-06-21, 01:52   #28
epatka
 
Jun 2003

25 Posts
Default

Hi Maybeso,

unfortunately, I don't understand this. Is this good news or bad news?

ui. Thanks for working on it :)
epatka is offline   Reply With Quote
Old 2003-06-22, 23:00   #29
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

2×137 Posts
Default

Hi Eva,

Well, the good news is, we can use the patterns of inverses (in binary) to recognise factors of mersenne numbers. The bad news is, it isn't very fast.

(Maybeso) Bruce
Maybeso is offline   Reply With Quote
Old 2003-06-22, 23:17   #30
epatka
 
Jun 2003

408 Posts
Default

Thanks Bruce,

too bad :(

What if we didn't finish the whole division, but would look for the point when the digits start to add up to 9?

This way we would save half the work.......

At least this is what I think/hope :)

Eva
epatka is offline   Reply With Quote
Old 2003-06-23, 20:25   #31
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

2×137 Posts
Default

Quote:
Originally Posted by epatka
What if we didn't finish the whole division, but would look for the point when the digits start to add up to 9?
Well, mersennes require we work in binary, so we would have to look for bits that added to 111 ... ;) But it will still work:

If N is 64 bits, then the digits would start with 64 0's, and we could watch for 64 1's. Actually, anything over 48 (3N/2), or even 32 (N/2) may be enough.

And if the digits don't add to 1's because the pattern has an odd width (what you originally took for composites) it would simply not exit early and complete the division.

Bruce
Maybeso is offline   Reply With Quote
Old 2003-06-23, 20:48   #32
epatka
 
Jun 2003

1000002 Posts
Default

Quote:
Well, mersennes require we work in binary, so we would have to look for bits that added to 111 ... ;) But it will still work:
That's good news sofar...... :)

Quote:
If N is 64 bits, then the digits would start with 64 0's, and we could watch for 64 1's. Actually, anything over 48 (3N/2), or even 32 (N/2) may be enough.
Problem is, the numbers we are testing have millions of digits. That would mean millions of 0's and 1's.......

Quote:
And if the digits don't add to 1's because the pattern has an odd width (what you originally took for composites) it would simply not exit early and complete the division.
Sorry, I don't understand. What did I take for composits? What do you mean by "odd width"?

Eva
epatka is offline   Reply With Quote
Old 2003-06-25, 02:19   #33
Maybeso
 
Maybeso's Avatar
 
Aug 2002
Portland, OR USA

4228 Posts
Default

Quote:
Originally Posted by Eva
Problem is, the numbers we are testing have millions of digits. That would mean millions of 0's and 1's.......
Well, we could start testing factors with 100 bits and work upward. The factors will be much smaller than the huge mersenne numbers they divide.

The program calculates 1/F using long division just like it's done by hand, except it uses binary.
For example, F = 97 = 1100001:[code:1] __0000001_ <- Step 2, add z 0's to Q, and a 1.
1100001 )10000000 <- Step 1, add z 0's to D until > F.
_1100001_ <- Step 3, subtract F from D.
11111 <- repeat until D = 1.
[/code:1]
For larger F, step 2 will produce millions of bits.
But other than watching for a block of 1's, we don't care what Q actually is.
We want how many bits are in Q. So we replace step 2 with:[list]Step 2, if (z > 0) add z to Q and reset ones_count, otherwise add 1 to ones_count.[/list:u]And if ones_count = leading_zeros, double Q and stop.
When it stops, F | 2^Q - 1.

Now we are counting to millions instead of storing millions of bits.

Quote:
Originally Posted by Eva
Sorry, I don't understand. What did I take for composites? What do you mean by "odd width"?
I was referring to your first post to start this topic, where you stated that the majority of primes seemed to share the trait of the repeating digit pattern of their inverses adding to 9's, while the majority of composites did not.

Look at my first post on page 2 of this topic.
In the second Code: block, the numbers in the "order" column are the width in bits of the repeating pattern. Notice that when the pattern is an even number of bits wide, you can split it in 2 and the halves will add to 11111... When it's an odd number of bits wide, you can't split it anywhere and have it add to 1111....
I think this is true for your decimal examples as well, and for any base.

Bruce
Maybeso is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 10 in Ubuntu, good idea, bad idea, or...? jasong jasong 8 2017-04-07 00:23
Idea (as always) Dubslow Forum Feedback 7 2016-12-02 14:26
idea ? science_man_88 Homework Help 0 2010-04-23 16:33
An Idea ThomRuley Lone Mersenne Hunters 5 2003-07-15 05:51
Just a little idea... Xyzzy PrimeNet 5 2003-06-30 03:19

All times are UTC. The time now is 17:47.


Fri Jul 16 17:47:13 UTC 2021 up 49 days, 15:34, 1 user, load averages: 1.92, 1.58, 1.52

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.