login
Replacing digits d in decimal expansion of n with d^3 yields a prime.
5

%I #25 May 01 2021 08:03:02

%S 11,13,23,31,41,43,53,61,73,101,107,109,121,137,143,149,151,157,161,

%T 169,173,181,191,211,217,221,229,233,241,253,257,259,271,277,281,299,

%U 307,311,313,319,323,331,421,427,431,449,469,493,511,527,541,577,589

%N Replacing digits d in decimal expansion of n with d^3 yields a prime.

%e 313 = (3)(1)(3) -> (27)(1)(27) = 27127, which is a prime.

%t Select[Range[600],PrimeQ[FromDigits[Flatten[IntegerDigits/@ (IntegerDigits[ #]^3)]]]&] (* _Harvey P. Dale_, Jan 27 2015 *)

%o (Python)

%o from sympy import primerange, isprime

%o for n in primerange(2,600):

%o t=int(''.join(str(int(i)**3) for i in str(n)))

%o if sympy.isprime(t):

%o print(n)

%o # _Abhiram R Devesh_, Feb 09 2015

%Y Cf. A048390, A048394.

%K nonn,base

%O 1,1

%A _Patrick De Geest_, Mar 15 1999

%E Offset corrected by _Michel Marcus_, Oct 19 2016