← RoseCode

ROSECODE 424

Vampire Numbers

Philippe_57721 · Programming ·

A vampire number is a 2k-digits number n such as there exist two k-digits numbers a and b such as:
- n=a×b
- the digits of a and b are exactly the digits of n

Example: 1001295697=19001×52697

The two factors a and b are called, quite logically, the fangs.

Find the first and last 10-digits vampire numbers not containing the digit 0 with prime fangs.

Anwer format: first,last

Example : 11722657,79168819 (for 8 digits)
(11722657=2267×517179168819=8171×9689)

[My timing: 82 sec]
Hint:
The first digits of last are 945