2 * pollard - factor using Pollard's p-1 method
4 * Copyright (C) 1999 David I. Bell
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.1 $
21 * @(#) $Id: pollard.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/pollard.cal,v $
24 * Under source code control: 1991/05/22 21:56:37
25 * File existed as early as: 1991
27 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
31 define pfactor(N, B, ai, af)
45 for (a = ai; a <= af; a++) {
48 if ((d > 1) && (d != N))