Re: Faster algorithm for factor?

2004-01-05 Thread Trevor Wilson
I was wrong in my last reply. Assuming the ERH, we have to check up to 2(ln n)^2 for possible witnesses. This can be up to 3935, but it's not too much of a slowdown. Up to about 2^48, the least witnesses are known and are no more than 17, so that saves us some work. We might also be able to get aw

Re: Faster algorithm for factor?

2004-01-05 Thread Trevor Wilson
That's a good question. It has been proven that 3/4 of numbers are witnesses for any given composite, so using 8 would give 1/2^16 chance of error. However, in practice this seems to be much better. Unfortunately, the greatest least witness (not a typo) for all numbers up to 2^64 has not yet been c

"sort" characters, ignoring fields, could use documentation

2004-01-05 Thread Jameson Burt
Consider including in the "sort" documentation ("man" and "info") how to sort character columns, irrespective of any fields. For example, "The following sorts columns 76 thru 80, irrespective of any delimited fields sort -k 1.76,1.80 file2 You must use 1.* (not something like 3.76,

Re: Faster algorithm for factor?

2004-01-05 Thread Jim Meyering
Trevor Wilson <[EMAIL PROTECTED]> wrote: > Yes, there is a bug for inputs >= 2^63 where the program does not > necessarily terminate. The program uses the Rabin-Miller primality test, > so it should return on primes almost immediately in general. Oh, yes. I see you already mentioned that. Here's

Re: Faster algorithm for factor?

2004-01-05 Thread Trevor Wilson
Yes, there is a bug for inputs >= 2^63 where the program does not necessarily terminate. The program uses the Rabin-Miller primality test, so it should return on primes almost immediately in general. --Trevor "Mathematics is like checkers in being suitable for the young, not too difficult, amusin

Re: bug in echo command

2004-01-05 Thread Alfred M. Szmidt
> echo "Today is \c " That probably uses the shell's built-in echo, not the external one from coreutils. The echo from coreutils behaves the same way. And both accept the -e switch. Cheers. ___ Bug-coreutils mailing list [EMAIL PROTECTE

Re: bug in echo command

2004-01-05 Thread Paul Jarc
"Alfred M. Szmidt" <[EMAIL PROTECTED]> wrote: >the echo command doesn't read string sequences such as \c or \r >even when the option -E is not used. -e is not supposed to be on by default, AFAICT. I think -E exists only to override an explicit -e. "/bin/echo -e" works for me. > echo

Re: bug in echo command

2004-01-05 Thread Alfred M. Szmidt
the echo command doesn't read string sequences such as \c or \r even when the option -E is not used. for example: echo "Today is \c " produces Today is c on the screen. >From the manual, (coreutils) echo invocation: `-e' Enable interpretation of the following backslash-es

Re: Faster algorithm for factor?

2004-01-05 Thread Jim Meyering
Trevor Wilson <[EMAIL PROTECTED]> wrote: > Here is the code for a factor-like program that uses Pollard's Rho > algorithm. It doesn't do any error-checking or anything fancy, but its > output is identical to that of factor, for testing purposes. > > It is slower for small inputs, so we should proba

Re: Faster algorithm for factor?

2004-01-05 Thread Trevor Wilson
I should add that my program sometimes fails for inputs >= 2^63. This is because of the way it performs the modular multiplication. If anyone has a better way to do this, please let me know. --Trevor "Mathematics is like checkers in being suitable for the young, not too difficult, amusing, and wi

Re: Faster algorithm for factor?

2004-01-05 Thread Trevor Wilson
Here is the code for a factor-like program that uses Pollard's Rho algorithm. It doesn't do any error-checking or anything fancy, but its output is identical to that of factor, for testing purposes. It is slower for small inputs, so we should probably fall back to the wheel method for these. Howev