Shortest code - Finding the kth good cipher Challenge: A cipher (which is a positive integer) which has any substring not divisible by 2, or has a substring divisible by 11 (other than 0), is defined as 'bad'. All other ciphers are defined as 'good'. Find the kth cipher, in ascending order, which is 'good'.

Input format

The first line of input has a single integer T, the total number of test cases. The next T lines each have an integer k on them.

Output Format

The output should contain T integers on T different lines, the kth good cipher.

Sample Input

2
1
136

Sample Output

2
4008
Perl, 75 74 characters

map{map{1while++$n=~/[13579]|(.+)(?(?{$^N&lt;1|$^N%11})!)/}1..&lt;&gt;;$n=say$n}1..&lt;&gt;


I should point out that the character count is taking advantage of Perl's bizarre feature of allowing a special variable of the form $^X to be spelled with a literal ctrl-X character.

The regex extensions being utilized are also terrifying, but boy do they come in handy.