## My Number Study: A Short Perl Script for Integer Factorization

This is no great revelation post, merely a progress report. See the script below, which is an automation of the procedure I am using and analyzing so far. It’s not nearly the quickest – I expect extreme slowness for anything remotely near the RSA challenge number! – but it’s a starting point which I will modify upon discovery of ways to use the patterns created by the integer floors of the sqrt(Discriminant) values for the series of polynomials I am solving here.

# #!/usr/bin/perl

use strict;
use warnings;
use POSIX qw/ceil/;
use POSIX qw/floor/;

my \$m = \$ARGV;
print “Factoring \$m…\n”;
my \$s = ceil( sqrt( \$m ) );
my \$r = \$s * \$s – \$m;
my \$b = 0;
my \$c = 0 – \$r;
my \$disc = \$b * \$b – 4 * \$c;
my \$rdisc = sqrt( \$disc );
my \$frdisc = floor( \$rdisc );
while ( \$frdisc != \$rdisc ) {
\$b++;
\$c -= \$s;
\$disc = \$b * \$b – 4 * \$c;
\$rdisc = sqrt( \$disc );
\$frdisc = floor( \$rdisc );
}
print “Factorization found at n = \$b, Root(D) = \$rdisc.\n”;

print “p = “, \$s + 0.5 * ( \$b – \$rdisc ), “; q = “, \$s + 0.5 * ( \$b + \$rdisc );
print “\n”;