Problems & Puzzles: Puzzles

Puzzle 471. n and n^2 use only prime digits

Farideh Firoozbakht sent one more puzzle from Zak Seidov:

Zak Seidov on the SeqFan mailing list,10 Dec 2008 questioned:

Q1. Are 5, 235 & 72335 the only numbers n such that n and n^2 use only prime digits?

{5, 235, 72335}^2={25, 55225, 5232352225}

Q2. You are able to pose variations on this same issue.



Jan van Delden wrote (Feb. 09)

No further solutions found (n maximal 30 digits).

I searched using recursion and disregarding patterns as soon as possible. Suppose n is equal to a (sofar) allowed pattern of digits. Put each of the numbers 2,3,5 and 7 in front of this pattern and square them. Test from right to left whether all the digits of these 4 squares are equal and prime. If a digit in this mutual tail is not prime, the original pattern is disregarded.

However (disregarding small n) some nice patterns emerge. [{a}(b) the digit a, repeated b times]

n=7{3}(k)5 then n^2=53{7}(k-2)80{2}(k+1)5 and
n=52{3}(k)5 then n^2=2738{7}(k-2)95{2}(k+1)5

[k>=2 for the n^2 term]

Both have the maximum number of allowed digits in the square for all searched patterns (except ofcourse the 3 given solutions), even when k>=0.

So although not a new solution, it suggests we can't achieve more then falling short by 2 digits for larger/most n and 1 for small n.


One could search for primedigits in (n,n^k), with k odd. [k even can't give a solution since only n ending in 5 is allowed and n^k with k>2 even ends in 625].
I found the solutions:
(n,n^3) n=3
(n,n^5) n=2 and no more (yet..)
The trouble for large n is that we can only control for the tail and not for the much longer head of n^k.

Maybe more interesting is the following:

Is it possible to find n such that n^k and n^l have prime digits, with k>l>1. (So no condition on the digits of n).

Or even a smart way to find n such that n^k has prime digits..



Records   |  Conjectures  |  Problems  |  Puzzles