mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Aliquot Sequences

Reply
 
Thread Tools
Old 2009-04-02, 08:58   #1
schickel
 
schickel's Avatar
 
"Frank <^>"
Dec 2004
CDP Janesville

41128 Posts
Default Format for .alq files

As posted in another thread, I've been in touch with Jesper Gerved who was the author of the elf-alq/alq-elf utilities and have the format of the files available.
Quote:
Originally Posted by Jesper Gerved
The ALQ File Format

16 bit oriented binary format. Only factors larger than 256 stored. The largest prime factor is not stored ! Each factor stored has a header, a 16 bit word. The 12 most significant bits are the index of the term. The 4 least significant bits are the number of 16 bit words of the factor. Then follows the factor with least significant words first (Intel "little endian" byte and word ordering). So to take an example from the start of the 276 sequence:

36 . 1470806764 = 2^2 * 7 * 3301 * 15913
37 . 1471882804 = 2^2 * 7 * 19 * 199 * 13903
38 . 1642613196 = 2^2 * 3 * 7 * 19554919
39 . 2737688884 = 2^2 * 7 * 2389 * 40927

Stores as
0x0241 24(hex) = 36(dec), 1 word
0x0CE5 = 3301(dec)
0x0271
0x0955

Note that nothing is stored for terms 37 and 38.

The augmented format (as of 2006) adds the convention that the 12 bit index
field holds the index modulo 4096. And that if the 4 bit word count is 0 (zero), then an additional 16 bit word is inserted holding the actual word count.
Fundamentally, this is an extension of Paul Zimmerman's fmt format into the binary realm. To expand an alq file, you start with the name to get the starting number, then trial divide by primes <257 to get the start of each line, then use the primes stored for each line, with the remainder after dividing everything out as the last prime. Very elegant.
schickel is offline   Reply With Quote
Old 2009-04-02, 09:06   #2
schickel
 
schickel's Avatar
 
"Frank <^>"
Dec 2004
CDP Janesville

2×1,061 Posts
Default The 21st century conversion tools

Also, here is a copy of the latest tool to convert to/from elf/alq. The source is not the most current, however. Jesper was apparently changing some hings for Wolfgang Creyaufmueller and an exe built from it will not work prooperly....
Quote:
Originally Posted by Jesper Gerved
Using ALQ

>alq
Converts all .elf files in the current directory into .alq files

>alq 276
Converts only 276.elf

>alq 50000 60000
Converts files in this interval

>alq "C:/Documents and Settings/Jesper/Application Data/alq/" Converts all .elf files in directory, the .alq files are put in the same directory

>alq "C:/Documents and Settings/Jesper/Application Data/alq/" "./" ... the resulting .alq files are put in the current directory

>alq fmt 276 1000
Converts all .fmt files in interval into .alq files, directories may be given as above

>alq txt
Text files into .alq

>alq alq
Convert from .alq into .elf. No other text output files are possible at present. Directories and intervals, or single sequences may be specified as above.

The order of parameters is of no importance, but if two directories are given, the first is source and the second is destination. Likewise, if two numbers are given, the first is minimum and the second maximum.

In Windows you may make a shortcut to alq.exe, edit the command line in the properties for the shortcut. I find this to be a convenient way of setting up conversions.


Text Formats

In the attached file 'Text Formats.txt" you will find some examples of text files that can be used as input for 'alq'. Note that Zimmermann's FMT format also stores only minimal information in order to reconstruct the sequence. Being a text format it does take up 2 to 3 times as much memory than ALQ, but this may be acceptable today when we have so much more memory than 20 years ago.
Attached Files
File Type: zip alq.zip (45.9 KB, 135 views)
schickel is offline   Reply With Quote
Old 2009-04-02, 09:09   #3
schickel
 
schickel's Avatar
 
"Frank <^>"
Dec 2004
CDP Janesville

2·1,061 Posts
Default A working version of alq.exe

After re-contacting Jesper, he sent me a working alq.exe. This actually can handle the elf for 11280, but, interestingly, alq2elf cannot handle the resulting alq file, so that lends credence to the "something about 11280 is too big" theory.....
Attached Files
File Type: exe alq.exe (56.0 KB, 128 views)
schickel is offline   Reply With Quote
Old 2009-04-02, 09:11   #4
schickel
 
schickel's Avatar
 
"Frank <^>"
Dec 2004
CDP Janesville

212210 Posts
Default Lastly, one more thing...

And lastly, here is the "Text format" files that shows the layout of several different of the text formats that are used....
Attached Files
File Type: txt Text Formats.txt (1.9 KB, 143 views)

Last fiddled with by schickel on 2009-04-02 at 09:20 Reason: Computer saving what I type, instead of what I meant
schickel is offline   Reply With Quote
Old 2009-04-02, 10:25   #5
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

638210 Posts
Default

My guess, since it failed at step 2048, is that something's treating the 16-bit header as a signed rather than an unsigned short.

Of course, the header assumes nobody's taking a sequence to more than 4096 steps, which is no longer true ...
fivemack is offline   Reply With Quote
Old 2009-04-02, 12:44   #6
schickel
 
schickel's Avatar
 
"Frank <^>"
Dec 2004
CDP Janesville

2·1,061 Posts
Default

Quote:
Originally Posted by fivemack View Post
My guess, since it failed at step 2048, is that something's treating the 16-bit header as a signed rather than an unsigned short.

Of course, the header assumes nobody's taking a sequence to more than 4096 steps, which is no longer true ...
I think it's size of the numbers combined with the length, not just the length of the sequence. I extended 144984 to over 7000 lines and the old programs have no problem converting in either direction. I think there's something about 11280 that is an extreme corner case. I was thinking about taking a look at some of the sequences on Christophe's page, they're up close to that high too.

It will also be interesting to encounter a sequence with a penultimate prime of >240 bits; we're almost to that point now....

Last fiddled with by schickel on 2009-04-02 at 12:46 Reason: Adding a thought....
schickel is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Posting log files or other text files Xyzzy Forum Feedback 3 2018-12-30 19:37
Converting CWI format to ggnfs format xilman Msieve 2 2015-11-27 09:54
CWI format --> GGNFS format R.D. Silverman Msieve 25 2013-04-17 07:40
worktodo.ini format S485122 PrimeNet 5 2008-11-03 14:54
Meaning and format of Phi, GF roger Miscellaneous Math 9 2007-01-21 06:33

All times are UTC. The time now is 16:07.

Thu Feb 25 16:07:23 UTC 2021 up 84 days, 12:18, 1 user, load averages: 1.85, 2.06, 1.99

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.