Skip to main content
The National Cipher Challenge

Reply To: Programming

A Tale of 2 Secrets Forums T.E.M.P.E.S.T. Programming Reply To: Programming

#113175
Robb27
Participant

@ByteInBits #113017

With the PARI/GP below I get 410256 as the number.

{
for (x=101,1000000,
    v=digits(x);
    len = #v;
    y = v[len];
	
    \\ Check if last digit is 0  or 1 to skip
    if (y == 0, next()); 
    if (y == 1, next()); 
	
    z=x*y;

    remaining_digits = v[1..len-1]; 	
    swapped_v = concat([y, remaining_digits]); 
    w = fromdigits(swapped_v); 
	
    if(w==z,
	print1("number= ",w)
      );
    );
}
Report a problem