Splitting Into Two Primes

Multiplying two large primes is easy. The result is a huge non-prime number. Factoring this number however, is non-trivial. This is the basis behind a lot of Cryptographic algorithms.

999415083136585001 is a product of two primes. These two primes are palindromes. Find the sum of these two palindromes.


The answer is 1999414998.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Michael Mendrin
Jan 21, 2016

The fact that the number starts with 999... 999... and ends with . . . 001 ...001 suggests that the both factors are of the form 999 x y x 999 \overline{999xyx999} . Following this hunch, we can expand

999415083136585001 ( 999000999 + 101000 a 1 + 10000 a 2 ) ( 999000999 + 101000 b 1 + 10000 b 2 ) ) = 999415083136585001-\left( 999000999+101000a_1+10000a_2 \right) \left( 999000999+101000b_1+10000b_2) \right) =

1412087133587000 100899100899000 a 1 9990009990000 a 2 1412087133587000 - 100899100899000 a_1 - 9990009990000 a_2 100899100899000 b 1 10201000000 a 1 b 1 1010000000 a 2 b 1 -100899100899000 b_1 - 10201000000 a_1 b_1 - 1010000000 a_2 b_1 9990009990000 b 2 1010000000 a 1 b 2 100000000 a 2 b 2 - 9990009990000 b_2 - 1010000000 a_1 b_2 - 100000000 a_2 b_2

From this we can deduce that b 1 = 13 a 1 b_1=13-a_1 and then b 2 = 10 a 2 b_2=10-a_2 , and then from those we end up with solving for a 1 a_1 :

10 c + 2 3 a 1 + a 1 2 = 0 10c+2-3a_1+a_1^{2}=0

where c c is an integer. From this, we find that a 1 = 6 , a 2 = 8 , b 1 = 7 , b 2 = 2 a_1=6, \; a_2=8, \; b_1=7,\; b_2=2 , and the numbers are

( 999686999 ) ( 999727999 ) = 999415083136585001 (999686999)(999727999)=999415083136585001

Arkin Dharawat
Feb 2, 2016

I used Fermat's Factorization,here N = 999415083136585001. N = a 2 b 2 N=a^{2}-b^{2} and so the two primes are a + b a+b and a b a-b .

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import math
def fermat(n):
    a = int(math.ceil(n**0.5))
    b2 = a*a - n
    b = int(b2**0.5)
    while b*b != b2:
        a = a + 1
        b2 = a*a - n
        b =int(b2**0.5)
    p=a+b
    q=a-b
    print p+q


n=999415083136585001
fermat(n)

Almost immediately,the output.i.e: 1999414998 \boxed{1999414998}

Mark Hennings
Jan 24, 2016

There are only 5953 5953 palindromic primes less than 1 0 9 10^9 (having a file listing the primes less than 1 0 9 10^9 after solving one of Thaddeus' previous problems was useful!). Checking the two of these which multiplied together to get the right answer was elementary: 999686999 × 999727999 = 999415083136585001 . 999686999 \times 999727999 \; = \; 999415083136585001 \;.

Kaleab Belete
Jan 24, 2016

I think optimal prime testing algorithms such as the Sieve of Eratosthenes would be appropriate for this problem. Since the number is a product of two palindromic prime numbers, it would be efficient to start from 999415083136585001 \sqrt{999415083136585001} and try incrementing and decrementing from there.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...