mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Information & Answers (https://www.mersenneforum.org/forumdisplay.php?f=38)
-   -   Interim and Res64 Residues (https://www.mersenneforum.org/showthread.php?t=10668)

Primeinator 2008-09-17 21:51

Interim and Res64 Residues
 
Can anyone point me to a source to help understand what the Interim Residues and Res64 residues actually mean or indicate? (i.e., the difference between the letters, numbers, etc). Thanks.

Mini-Geek 2008-09-17 21:58

The letters and numbers are hexadecimal (base 16), which is represented with 0-F. I think the res64/interim residues is the last 64 bits of the residue encoded in hexadecimal, but I'm not sure on this.

cheesehead 2008-09-17 23:15

[quote=Primeinator;142965]Can anyone point me to a source to help understand what the Interim Residues and Res64 residues actually mean or indicate? (i.e., the difference between the letters, numbers, etc). Thanks.[/quote]Mini-Geek is correct.

In the Lucas-Lehmer test's series of iterations, the result value of the final iteration (which is zero only if the number being tested is prime) is called the residue.

An "interim residue" is the value computed at some iteration [I]before[/I] the last one.

Because these residues can be millions of bits long, it has been traditional to save only the last (right-most, low-order) few bits of it for later comparison. A "Res64 residue" means the last 64 bits of a (full) residue value.

In the "old days", some saved residues were only the final 15 bits.

For an explanation of hexadecimal notation, see the Wikipedia article at [URL]http://en.wikipedia.org/wiki/Hexadecimal[/URL].

Primeinator 2008-09-17 23:43

[QUOTE]For an explanation of hexadecimal notation, see the Wikipedia article at [url]http://en.wikipedia.org/wiki/Hexadecimal[/url]. [/QUOTE]

Thank you. That clears up what each character represents. Now my question is this (as the above Wiki article did not clarify this well): What does a string of these characters mean? It was all well and good to know that A means 10 or F equals 15 or 7 equals 7. However what does AA02FIF8BCFB0F1C mean and how could you so easily spot "fake" residues seen in the posts relating to M45 and M46?

Mini-Geek 2008-09-18 00:04

[quote=Primeinator;142987]Thank you. That clears up what each character represents. Now my question is this (as the above Wiki article did not clarify this well): What does a string of these characters mean? It was all well and good to know that A means 10 or F equals 15 or 7 equals 7. However what does AA02FIF8BCFB0F1C mean and how could you so easily spot "fake" residues seen in the posts relating to M45 and M46?[/quote]
The string of characters is the same as how you might say in decimal 43112609 to mean 4*10^7 + ... + 9*10^0, except you might say something like AA02FF8BCFB0F1C (BTW "I" isn't a possible hex value, as hex consists only of 0-9 and A-F) for (all in base 16 BTW where "10" means 16 in decimal) A*10^E + ... + C*10^0.

The fake residue is so easily spotted because the way to generate it is known, and becomes pretty easy to see when you look at the binary of the residue. See [URL]http://www.mersenneforum.org/showpost.php?p=139789&postcount=25[/URL] for more information, which can be summed up in that certain parts of the exponent are taken in binary and used as certain parts of the fake residue.

In case you're wondering why hex is used here for the last 64 bits instead of binary, it's because hex can use a fourth the space that binary does to show the same thing, while still showing a close connection to the binary digits.

cheesehead 2008-09-18 00:31

[quote=Primeinator;142987]Now my question is this (as the above Wiki article did not clarify this well):[/quote]Hmmm ... you're right. Although it says "[I][URL="http://en.wikipedia.org/wiki/Base_(mathematics)"]base[/URL]-[URL="http://en.wikipedia.org/wiki/16_(number)"]16[/URL][/I]" and "[URL="http://en.wikipedia.org/wiki/Numeral_system"]numeral system[/URL] with a [URL="http://en.wikipedia.org/wiki/Radix"]radix[/URL], or base, of 16" right up at the top, it therafter assumes the reader knows all that "base" implies. There seems to be no explanatory (not just bare numbers) example of decimal-to-hexadecimal or hexadecimal-to-decimal translation, and not until the "Binary translation" section does it explain a binary-to-hexadecimal translation.

The subsection "Division-remainder in source base" under "Converting from other bases" gives an algorithm that is correct as far as I can tell, but no explicitly-worked-out example (tsk, tsk). Then, in the next subsection, "Addition and multiplication" under "Converting from other bases", is, [I]at last[/I], [B]an _explanatory_ conversion of hexadecimal B3AD to decimal 45997[/B]. Hard to find, under a misleading subheading, and no demonstration of decimal-to-hexadecimal conversion!

- - -

Here may be a better explanation:

"How to convert between decimal and hexadecimal numbers" at [URL]http://www.ehow.com/how_2264926_convert-between-decimal-hexadecimal-numbers.html[/URL]

(Ignore the in-joke "Oct 31 = Dec 25".)

Primeinator 2008-09-18 01:13

Alright, then I understand how to get the decimal representation of the hexadecimal residue. Now, is that decimal remainder the remainder of the modulo arithmatic in the Lucas Lehmer test?

[QUOTE]The fake residue is so easily spotted because the way to generate it is known, and becomes pretty easy to see when you look at the binary of the residue. See [url]http://www.mersenneforum.org/showpos...9&postcount=25[/url] for more information, which can be summed up in that certain parts of the exponent are taken in binary and used as certain parts of the fake residue.
[/QUOTE]

:confused:

jrk 2008-09-18 01:24

It is the last 64 bits of the remainder.

So it is the remainder modulo 2^64.

jrk 2008-09-18 01:26

[quote=Primeinator;143001][quote]The fake residue is so easily spotted because the way to generate it is known, and becomes pretty easy to see when you look at the binary of the residue. See [URL]http://www.mersenneforum.org/showpos...9&postcount=25[/URL] for more information, which can be summed up in that certain parts of the exponent are taken in binary and used as certain parts of the fake residue.[/quote]:confused:[/quote]

It means the residues on those exponents are made-up, not the actual residue from completing the test (this is a way to mask the new prime from being widely known before it is verified).

Primeinator 2008-09-18 02:52

[QUOTE]It is the last 64 bits of the remainder.

So it is the remainder modulo 2^64.[/QUOTE]

Ahh, the lightbulb.

[QUOTE]It means the residues on those exponents are made-up, not the actual residue from completing the test (this is a way to mask the new prime from being widely known before it is verified).[/QUOTE]

This part I understand, but what "makes" one bit of hexadecimal look suspicious over another? I tried the link, but it does not work.

ATH 2008-09-18 09:25

Here is a more detailed explaination of the fake residue algorithm: [URL="http://www.hoegge.dk/mersenne/residue.txt"]residue.txt[/URL]


[QUOTE=Primeinator;143009]This part I understand, but what "makes" one bit of hexadecimal look suspicious over another? I tried the link, but it does not work.[/QUOTE]

Since it involves the exponent mod 16 and since a prime number can only be 1,3,5,7,9,11,13,15 mod 16 the fake residue will always start with one of these possibilities:

0x1248, 0x36C8, 0x5A48, 0x7EC8, 0x9248, 0xB6C8, 0xDA48, 0xFEC8

Looking at the fake residues used there are many common sequences which make them look "suspicious", like 7EC801, C8012, 8013 and so on.

real M39: 13466917 0x5A4800136C936D__
real M40: 20996011 0xB6C80125A48000__
real M41: 24036583 0x7EC80125B6DB7E__
real M42: 25964951 0x7EC80136C8136C__
real M43: 30402457 0x92480137EC937F__
fake M44:29225803 0xB6C80136DB7FED__
fake M45:20314069 0x5A480124936DA5__
fake M45:43021553 0x1248125A492480__
fake M46:32428427 0xB6C80137FEDB7E__

Primeinator 2008-09-18 15:37

[QUOTE]Here is a more detailed explaination of the fake residue algorithm: residue.txt[/QUOTE]

That is helpful, thank you. However, what do the x and __ symbolize? I count only 16 "valid" characters on the examples you provided from the reals and fakes.

henryzz 2008-09-18 15:46

[quote=Primeinator;143075]That is helpful, thank you. However, what do the x and __ symbolize? I count only 16 "valid" characters on the examples you provided from the reals and fakes.[/quote]
0x is added to the beginning of a hex number to show it is hex and __ shows there is more than what is shown

Primeinator 2008-09-18 16:10

[QUOTE]0x is added to the beginning of a hex number to show it is hex and __ shows there is more than what is shown[/QUOTE]

Thanks, this is the "last" piece of the puzzle.

I feel I have a rudimentary grasp of the hexidecimal residues now. I will do further investigation on my own. Thank you to all who provided me asssistance and were patient with me!

ATH 2008-09-19 08:46

Only 14 of the 16 residue digits are shown and last 2 is hidden by __, to be sure doublechecks are really genuine. Only on your own LL tests can you see all 16 digits.


All times are UTC. The time now is 20:41.

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