-Can n > p? The number is n^2(n+p), where n+p is co-prime to n (WRONG! n~~ can~~

+Can n > p? The number is n^2(n+p), where n+p is co-prime to n (WRONG! n

may be divisible by p). So n^2 must

be a perfect cube and so does n+p. In order for n^2 to be a cube, so does n.

-But the difference between two cubes cannot be a prime number because:

-a^3 – b^3 = (a – b)(a^2 + ab + b^2). Ergo: n <= p.

+The difference between two cubes is:

+a^3 – b^3 = (a – b)(a^2 + ab + b^2), so it can be prime only if

+a - b = 1 . Ergo: n <= p.

n != p because otherwise the number will be 2n^3 which cannot be a cube.

open my $primes_fh, "primes 2 1000000|"

or die "Cannot open primes program!";

+my @primes = <$primes_fh>;

+@primes_map{@primes} = ((1) x @primes);

+ my $to_check = ($root * $root + $root * ($root+1) + ($root+1) * ($root+1));

+ if ($to_check > 1_000_000)

+ if (exists($primes_map{"$to_check"}))

+ print "Found $to_check ; Total found = $total_count\n";

+ print "$to_check is not prime.\n";

while (my $prime = <$primes_fh>)

if ($x->copy->broot(3)->bpow(3) == $x)

- print "Found $prime. Total: $found_count\n";

+ print "Found $prime with $n. Total: $found_count\n";