🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.crypt
Article #2908

Re: Is N a prime power?

#2908
From: Matthias Urlichs
Date: Tue, 26 Jan 1993 01:24
30 lines
1670 bytes
In sci.crypt, article <C1Exs1.8uz@ms.uky.edu>,
  jedwards@ms.uky.edu (Jonathan Edwards) writes:
> I am reading an old paper by Tompa that describes Blum's protocol for
> flipping coins by telephone.  The first thing the verifier must do is
> verify that a very large (hundreds of digits) number has at least two
> distinct prime factors (i.e., that the number is not a prime power).
> Tompa gives no hint how to do this and I haven't been able to find anyone
> else who knows.  I'd very much appreciate it if someone could explain
> how it's done or point me to a paper somewhere...

This is probably a very stupid algorithm, but..:

isprimeroot(x) ::=

if(x prime) return TRUE;
for all n >= 2, n prime:
   y = x ^ (1/n)
   if (y integer) { if (y prime) return TRUE, else return FALSE }
   if (y < 2) return FALSE.

How to calculate n'th roots is left as an exercise to the reader.

Warning: The above is off the top of my head, so it may or may not be correct.

-- 
A spilled drink flows in the direction of the most expensive object.
                                       -- "The New Official Rules"
-- 
Matthias Urlichs  --  urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de   /(o\
Humboldtstrasse 7 -- 7500 Karlsruhe 1 -- Germany  --  +49-721-9612521     \o)/
Technical Details
Message-ID: <1k23rp$392@smurf.sub.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!smurf.sub.org!news
References: <C1Exs1.8uz@ms.uky.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!smurf.sub.org!news
From: urlichs@smurf.sub.org (Matthias Urlichs)
Newsgroups: sci.crypt
Subject: Re: Is N a prime power?
Date: 26 Jan 1993 02:24:09 +0100
Organization: University of Karlsruhe, FRG
Lines: 30
Message-ID: <1k23rp$392@smurf.sub.org>
References: <C1Exs1.8uz@ms.uky.edu>
NNTP-Posting-Host: 127.0.0.1