Jon Strayer wrote:
> On 6/5/07, Mike McCarty <[EMAIL PROTECTED]> wrote:
> 
>>Jon Strayer wrote:
>>
>>>On 6/4/07, Jim Howell <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>>>So, are you saying that your program finds all primes below 100?  That
>>>>doesn't sound very useful, since those primes are very well-known
>>
>>already.
>>
>>>>--Jim
>>>
>>>
>>>
>>>The 100 is a variable.
>>
>>I guess I'm missing something. Your program missed some primes
>>not much larger than 100. Are you claiming that your program
>>would not have missed these primes if you increased that
>>variable?
> 
> 
> 
> "He", not me.  He is claiming that his program will find all primes less
> than X (for any value X) and some primes larger than X.  The problem I'm
> having is that I don't know either Mu Pad or German.  The combination is
> making it hard for me to understand the code.  But from what I'm seeing his
> algorithm doesn't require starting at 1. This makes me suspect it's not
> going to find all primes.
> 
> Can anyone comment on these equations?
> 
> 2x^2 + 1        p = 1,3 mod 8,
> 4x^2 + 1        p = 1 mod 4     and
> 2x^2 - 1        p = 1,7 mod 8.
> 
> 
> 

Ok, I can give you a translation of the German, at least...

I guess that erg is an abb. of "Ergebnis", which means
"result" or "outcome", sth like that. "Siebung" is "sieving"
and "stelle" is "place". The syntax looks a lot like Pascal
with a smidgen of Algol thrown in. (The old Algol, not the
one with "elihw" and "esac" in it. Algol60, IIRC.)

liste_max:=100;
z:={};

siebung:=proc (stelle)              sieve:=proc(place)
begin
    while (stelle<=liste_max) do     while (place <= list_max) do
        erg:=liste[stelle];             result = list[place]
        erg:=erg /p;                    result = result /p;
        while (erg mod p = 0) do        while (result mod p = 0) do
           erg:=erg /p;                    result = result /p;
        end_while;                      end_while;
        liste[stelle]:=erg;             list[place] = result;
        stelle:=stelle+p;               place = place+p;
    end_while;                       end_while
end_proc;


// 1. Polynom 4*x2+1
for x from 1 to liste_max do
    liste [x]:=4*x2+1;
end_for;

for x from 1 to liste_max do
    p:=liste[x];
    if (p>1) then
    // print ("x = ", x, "Prim = ", p) ;
       z:=z union {p};
       siebung (x+p);      IOW sieve(x+p);
       siebung (p-x);      IOW sieve(p-x);
    end_if;
end_for;

// 2. Polynom 2*x2+1

for x from 1 to liste_max do
    liste [x]:=2*x2+1;
end_for;

for x from 1 to liste_max do
    p:=liste[x];
    if (p>1) then
       z:=z union {p};
       // print ("x = ", x, "Prim = ", p) ;
       siebung (x+p);
       siebung (p-x);
    end_if;
end_for;

// 3. Polynom 2*x2-1

for x from 1 to liste_max do
    liste [x]:=2*x2-1;
end_for;

for x from 1 to liste_max do
    p:=liste[x];
    if (p>1) then
       z:=z union {p};
     // print ("x = ", x, "Prim = ", p) ;
       siebung (x+p);
       siebung (p-x);
    end_if;
end_for;

print (z)


Anyway, that's my contribution. I guess the translation is pretty
obvious to you now.

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!
_______________________________________________
Prime mailing list
[email protected]
http://hogranch.com/mailman/listinfo/prime

Reply via email to