Timer is Running

Given a number '**N**'. The task is to find the N^{th} number whose each digit is a prime number i.e 2, 3, 5, 7. In other words, you have to find the 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.

**Expected Auxiliary Space: **O(N).

**Constraints:**

1 <= T <= 100

1 <= N <= 100

**Examples:
Input:**

2

10

21

33

222

**Explanation:
Testcase 1:** 10

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.

tekuripurushotham | 64 |

omkarjadhav1191 | 63 |

visutkarsh2000 | 62 |

ayushaggarwal821 | 51 |

dixitabhyuday | 38 |

abnandi04 | 776 |

ponnadasaikesav | 450 |

KshamaGupta | 446 |

yogesh_aka_dante | 405 |

mummy | 313 |

blackshadows | 5362 |

Ibrahim Nash | 5244 |

akhayrutdinov | 5111 |

mb1973 | 4976 |

Quandray | 4752 |

Login to report an issue on this page.