Prime-cubes can be good too!

Call a positive integer N N good \textbf{good} , if it is prime and the cube of the number in decimal representation can be split into 3 parts such that their sum adds up to the original number.

Let N 1 , N 2 , N 3 , . . . , N n N_1, N_2, N_3, ..., N_n be all of the distinct good \textbf{good} numbers on the interval [ 1 , 1 0 9 ] [1, 10^9] . Determine the value of R R if:

i = 1 n N i N i R m o d 1 0 10 \sum^{n}_{i=1}N_{i}^{N_{i}}\equiv R \mod10^{10}

Details and Test cases :

  • 0 0 is not a positive integer.
  • Consider 29 7 3 = 26198073 297^3= 26198073 . So, 26 + 198 + 73 = 297 26+198+73 = 297 . But it is not a good number since 297 297 is not prime.


The answer is 5786109027.

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.

1 solution

Mark Hennings
Dec 28, 2015

There are three good numbers between 1 1 and 1 0 9 10^9 , namely 1302571 77767777 945134639 1302571 \qquad 77767777 \qquad 945134639 Observe that 130257 1 3 = 2210060766154315411 1302571 = 221006 + ( 0 ) 766154 + 315411 7776777 7 3 = 470326072320873707526433 77767777 = 47032607 + 23208737 + ( 0 ) 7526433 94513463 9 3 = 844269384373282700092959119 945134639 = 8442693 + 843732827 + ( 000 ) 92959119 \begin{array}{rcl} 1302571^3 & = & 2210060766154315411 \\ 1302571 & = & 221006 + (0)766154 + 315411 \\ 77767777^3 & = & 470326072320873707526433 \\ 77767777 & = & 47032607 + 23208737 + (0)7526433 \\ 945134639^3 & = & 844269384373282700092959119 \\ 945134639 & = & 8442693 + 843732827 + (000)92959119 \end{array} There are no others. I listed the 50847534 50847534 primes between 1 1 and 1 0 9 10^9 (an export from Mathematica), and tested these numbers for goodness, using the Delphi code:

function TForm1.HalfGood(u: string): Boolean; 
var
a,b,aa,bb: Integer;
bc: String;
p,q,r,s: Int64;
begin
 bc := BigCube(StrToInt(u));
 s := StrToInt(u);  
 Result := False;
 for a := 1 to Length(u) do
   for b := a+1 to Length(bc) do
     begin
       aa := a+1;
       while ((aa <= b) and (bc[aa] = '0')) do Inc(aa);
       if b + 1 - aa > Length(u) then continue;
       bb := b+1;
       while ((bb <= Length(bc)) and (bc[bb] = '0')) do Inc(bb);
       if Length(bc) + 1 - bb > Length(u) then continue;
       p := StrToInt(Copy(bc,1,a));
       if aa > b then
         q := 0
       else
         q := StrToInt(Copy(bc,aa,b+1-aa));
       if bb > Length(bc) then
         r := 0
       else
         r := StrToInt(Copy(bc,bb,Length(bc)));
       if p+q+r = s then
        begin
          Result := True;
          exit;
        end;
     end;
 end;

where BigCube is a routine that provides the decimal expansion of the cube of a number less than 1 0 10 10^{10} as a string.

Since, modulo 1 0 10 10^{10} , we have 130257 1 1302571 7128273571 7776777 7 77767777 1393177697 94513463 9 945134639 7264657359 \begin{array}{rcl} 1302571^{1302571} & \equiv & 7128273571 \\ 77767777^{77767777} & \equiv & 1393177697 \\ 945134639^{945134639} & \equiv & 7264657359 \end{array} the answer is 5786109027 5786109027 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...