A153025 Numbers n with property that n and n^2 use only prime digits.
5, 235, 72335
Offset: 1
Examples
The squares of 5, 235, 72335 are 25, 55225, 5232352225.
Programs
-
Mathematica
Flatten[Table[Select[FromDigits/@Tuples[{2,3,5,7},n],AllTrue[ IntegerDigits[ #^2], PrimeQ]&],{n,5}]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 16 2014 *)
Extensions
Edited by David Wilson and N. J. A. Sloane, Jan 25 2009
Comments