Every palindrome with an even number of digits is divisible by 11, so 11 is the only [palindromic prime] with an even number of digits. - David Wasserman, OEIS
I learned this today the manual way, before I did my research, when my program skipped numbers with an even number of digits (except 11) when calculating palindromic primes. Your task: create a program or function that when given an integer input N, outputs the Nth term in Stephen's Palindromic Sequence™.
Stephen's Palindromic Sequence™
Stephen's Palindromic Sequence™ starts with 11, and continues with palindromic semiprimes divisible by 11. Basically, all of the semiprimes that would be primes if 11 didn't "count." The upside is that this list contains numbers with an even number of digits! Yay. And, a lot of numbers with an odd number of digits are skipped, since they were already prime.
The beginning of the sequence:
1 : 11
2 : 22
3 : 33
4 : 55
5 : 77
6 : 121
7 : 737
8 : 979
9 : 1111
10 : 1441
11 : 1661
12 : 1991
13 : 3113
14 : 3223
15 : 3443
16 : 3883
17 : 7117
18 : 7447
19 : 7997
20 : 9119
21 : 9229
22 : 9449
23 : 10901
*Although 1331 (11^3) and similar fit the spirit of this sequence, they do not fit the rules.
Longer test cases:
26 : 91619
31 : 103301
41 : 139931
51 : 173371
61 : 305503
71 : 355553
81 : 395593
91 : 725527
101 : 772277
127 : 997799
128 : 1099901
141 : 3190913
151 : 3739373
161 : 7589857
171 : 9460649
200 : 11744711
528 : 39988993
Input
Integer N, >= 1. You can use a 0-indexed N (be sure to adjust test cases) if you specify so in your answer. Trailing newlines allowed.
Output
The Nth term in Stephen's Palindromic Sequence™. Trailing newlines allowed.
Rules
- The only input your program/function can take is N. Your program cannot, for example, fetch a sequence from OEIS (aka standard loopholes apply).
- You must be able to print an output up to six digits (N=127). Time is not a factor - however, if your program/function gets very long very fast, you must prove that the algorithm works. If your language naturally allows longer outputs, it you can let it expand naturally up to its limit, or cap it at ten digits, whichever you prefer. Output/termination beyond your limit does not matter, as long as it does not appear to be a valid output.
- Program/function function on invalid input is irrelevant.