human
Right | Generate all prime numbers less than n ..
Initialize all entries of boolean array as true . A value in isPrime [ i ] will finally be false if i is Not a prime , else true bool isPrime [ n + 1 ].
.
If isPrime [ p ] is not changed , then it is a prime.
Update all multiples of p.
Returns true if n is right - truncatable , else false.
Generating primes using Sieve.
Checking whether the number remains prime when the last ( " right " ) digit is successively removed.
Driven program"
Solution in Python:

What is a code to right and the other steps required?
assistant
#Here is code to right and the other steps required.
 def sieveOfEratosthenes ( n , isPrime ) :
	isPrime [ 0 ] = isPrime [ 1 ] = False
	for i in range ( 2 , n + 1 ) :
		isPrime [ i ] = True
	p = 2
	while ( p * p <= n ) :
		if ( isPrime [ p ] == True ) :
			i = p * 2
			while ( i <= n ) :
				isPrime [ i ] = False
				i = i + p
		p = p + 1
def rightTruPrime ( n ) :
	isPrime = [ None ] * ( n + 1 )
	sieveOfEratosthenes ( n , isPrime )
	while ( n != 0 ) :
		if ( isPrime [ n ] ) :
			n = n // 10
		else :
			return False
	return True
n = 59399
if ( rightTruPrime ( n ) ) :
	print ( " Yes " )
else :
	print ( " No " )