mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Math (https://www.mersenneforum.org/forumdisplay.php?f=8)
-   -   Looking for a sieving program (https://www.mersenneforum.org/showthread.php?t=7536)

jasong 2007-03-18 00:24

Looking for a sieving program
 
Is there a program out there, where you can enter a range of numbers, and it will tell you any factors below a million, a billion, or...?

Mind you, these aren't special form numbers, these are sequential numbers.

Xyzzy 2007-03-18 02:16

1 Attachment(s)
[quote]Is there a program out there, where you can enter a range of numbers, and it will tell you any factors below a million, a billion, or...?

Mind you, these aren't special form numbers, these are sequential numbers.[/quote]If you are running BASH (which you should) try:

[code]for i in `seq 2 10000`; do factor $i; done[/code]It ain't fast, but it works. Adjust the numbers as appropriate.

[SIZE=1] When we say it ain't fast, we aren't joking. You could factor these by hand faster. Or something.[/SIZE]

Xyzzy 2007-03-18 14:34

In case you want to list the primes, here is a very ugly BASH program.

[code]cat [I]file[/I] | cut -d ':' -f 2 | sed 's/^ //' | grep -v ' '[/code]This assumes you sent the output from the first program to a file. You could do it on the fly but it would just slow things down even more, which, we know, sounds impossible to believe.

jasong 2007-03-18 20:39

Since there doesn't seem to be a program that fits my needs, I guess I might as well reveal what I wanted to do. I wanted to find the lowest 114-digit number with two brilliant factors. A brilliant number is a number where all the prime factors have the same number of digits. So far, digits 1 through 113 are spoken for.

Xyzzy 2007-03-19 01:14

[quote]Is there a program out there, where you can enter a range of numbers, and it will tell you any factors below a million, a billion, or...?[/quote]
114 digit numbers are a little bigger than what you hinted at.

:unsure:

cheesehead 2007-03-19 02:50

[quote=Xyzzy;101296]114 digit numbers are a little bigger than what you hinted at.[/quote]jasong's original posting contained no hint, misleading or otherwise, about the size of numbers he sought to factor. His mention of "factors below a million, a billion, or..." hints only at size of possible factors, not of the numbers to be factored.

Xyzzy 2007-03-19 03:09

Stop making sense. It hurts us so.

[SIZE=1][COLOR=White]The rock and pool
Is nice and cool
So juicy sweet

Our only wish
To catch a fish
So juicy sweet[/COLOR][/SIZE]

Xyzzy 2007-03-19 17:33

1 Attachment(s)
Why? Because we were bored.

How long did it take? You don't want to know.

Was it pointless? Of course!

:yzzyx:

xilman 2007-03-19 19:22

[QUOTE=jasong;101280]Since there doesn't seem to be a program that fits my needs, I guess I might as well reveal what I wanted to do. I wanted to find the lowest 114-digit number with two brilliant factors. A brilliant number is a number where all the prime factors have the same number of digits. So far, digits 1 through 113 are spoken for.[/QUOTE]Now you've told us what you want, we can give sensible answers.

First off, write a simple program (yes, write it for yourself --- if you can't write it you're not going to succeed in everything else that's needed) which divide all numbers between (say 100^113 and 10^113+1000000) by small primes --- those under 1000 say. Anything which isn't divisible by one of those, you write to a file.

There are any number of programming languages which will let you do this first stage. If you're on a MS operating system, UBASIC is as good as any and better than most.


Then, once you've found all the numbers of interest without any small factors, get hold of an ECM program and use it to find medium size factors of those. GMP-ECM is the most effecient I know of and it's been ported to many operating systems. Keep using ECM, with ever larger B1 limit, until you get bored. Every time you find a factor of an integer N, remove it from your list.


After that phase is over --- it will probably take you only a month or so unless you've serious amount of computation available --- get hold of a NFS factoring package and use it to do each of the remaining candidates in order of size. Sooner or later you will find a brilliant number.

Beware: it took me about 5 years to find the smallest 150-brilliant number.

Good luck!


Paul

Xyzzy 2007-03-19 19:30

[quote]Beware: it took me about 5 years to find the smallest 150-brilliant number.[/quote]
On a Sinclair ZX81.

And he was happy to have it!

Citrix 2007-03-19 21:55

[QUOTE=xilman;101421]Now you've told us what you want, we can give sensible answers.

First off, write a simple program (yes, write it for yourself --- if you can't write it you're not going to succeed in everything else that's needed) which divide all numbers between (say 100^113 and 10^113+1000000) by small primes --- those under 1000 say. Anything which isn't divisible by one of those, you write to a file.


Paul[/QUOTE]

I think you can use newpgen for this, though I am not sure. Check it out for yourself.


All times are UTC. The time now is 11:01.

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