what is the probability xth of card not being destroyed? Initially i have N cards with value(1,2,..N) , each time i will destroy cards based on number of card left.
If N is odd , will leave smallest value card and destroy the half of the remaining cards.
If N is even will destroy half of the card.
what is the probability that Xth card is not being destroyed till last round?
Note: Each card has equal probability of not being destroyed.
 A: It very much depends on $N$ and not in a simple way.

So, lets take thirteen cards as an example.  In four steps :


*

*You keep 1 and destroy six, leaving seven cards.

*You keep 1 and destroy three, leaving four cards.

*You destroy two cards, leaving two. 

*You destroy one card.
The probability for retaining 1 is $1/4$, and that for retaining any other particular card is: $1/16$.

Take fourteen cards.


*

*You destroy seven, leaving seven cards.


*

*The lowest card left is: $k\in\{1,2,3,4,5,6,7,8\}$ with probability $\binom{14-k}{8-k}/\binom{14}{7}$


*You keep the lowest(which?) and destroy three cards, leaving four cards.

*You destroy two cards, leaving two cards. 

*You destroy one card.
So the probability of a card being retained is ...?
A: This is not a full solution, but it should set the stage for a computer algorithm. 
Fix $N$, and say we know we have $K$ trials for $X$ to survive. What you want to keep track of are the numbers 
$\mathbb{P}[X\text{ and }b\text{ cards }<X \text{ survives }i\text{-th trial}|X\text{ and }a\text{ cards }<X\text{ survives }i-1\text{-th trial}]$ for $b\leq a$. Notice that this number is independent of $i$ once we know whether this trial includes an odd amount of cards or not. Let $N_i$ be the number of cards left just before the $i$-th trial, so that if $N_i$ is even then the probability is $\frac{1}{2}\mathbb{P}[\text{Hypergeometric}(N_i-1,a,\frac{N_i}{2})=a-b]$. If $N_i$ is odd the probability is $1_{a=0}+1_{a>0}\frac{1}{2}\mathbb{P}[\text{Hypergeometric}(N_i,a,\frac{N_i}{2})=a-b]$. If we call these numbers $c_{b,a}^i$, and let $c^i_b=\mathbb{P}[X\text{ and }b\text{ cards }<X\text{ survive }i\text{-th round}]$, then $c^i_b=\sum_{a\geq b}c_{b,a}^ic_a^{i-1}$. Note we don't need to track $N_i$ as it is non-random. We also have the starting point $c_{X-1}^0=1$, and you can see this equation as $c^i=C^ic^{i-1}$ where the matrix $C^i$ is lower-triangular and $(C^i)_{b,a}=c_{b,a}^i$. 
With that in mind I would consider the following code. For fixed $N$, run the division, find $N_i$ for all $i\leq K$, find $C^i$ based on $N_i$, then iteratively solve $c^i=C^{a_i}c^{i-1}$ until you get to $i=K$. I think this is your best bet because I don't think getting a closed form solution is tractable. 
Edit: Okay, I said not tractable, in simple cases like $N=2^n$ or $N=2^n+1$ for some $n$ you can show that the probability is $\frac{1}{N}$, or $\frac{1}{2}$ for 1 and  $\frac{1}{2(N-1)}$ otherwise respectively. In cases like $N=2^m(2^n+1)$ you can show that the probability is $\frac{1}{2^m+1}$ for $X=1$, and with some work you might be able to get a closed form for other $X$'s in this case. 
