Nth number made of prime digits
Submissions: 1057   Accuracy:

44.68%

  Difficulty: Easy   Marks: 2

Given a number 'N'. The task is to find the Nth number whose each digit is a prime number i.e 2, 3, 5, 7. In other words you have to find nth number of this sequence : 2, 3, 5, 7, 22, 23 ,.. and so on.

Input:
The first line contains a single integer T i.e. the number of test cases. The first and only line of each test case consists of an integer N

Output: 
In one line print the nth number of the given sequence made of prime digits.

Constraints:
1 <= T <= 100
1 <= N <= 100

Examples:
Input:

2
10
21

Output:
33
222

Explanation:
Testcase 1:
10th number in the sequence of numbers whose each digit is prime is 33.

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.