There's really no magic to the trick; I just used a brute-force method in my analysis.
Here is how I figured it out:
I will use b1 to mean the first burn card, b2 for the second, etc.
So the 13 cards at the beginning must be:
A b1 2 b2 3 b3 4 b4 5 b5 6 b6 7
So, you already know where seven of the cards go.
Now, the next cards after you put down the 7 card are the first six burn cards:
b1 b2 b3 b4 b5 b6
You must burn a card after you put down the 7 and that would be b1.
So, the cards you have in your hand after that are (in order):
b2 b3 b4 b5 b6 b1
So, just match up the last six cards since every other one must be burned:
b2 b3 b4 b5 b6 b1
8 9 10 b2=8 then burn b3 then b4=9 then burn b5 then b6=10
J Q then burn b1 then b3=J then burn b5 then b1=Q
K then b5=K.
Therefore,
b1 = Q
b2 = 8
b3 = J
b4 = 9
b5 = K
b6 = 10
Now, plug those back into the original sequence of cards and you have your answer!
A b1 2 b2 3 b3 4 b4 5 b5 6 b6 7
A Q 2 8 3 J 4 9 5 K 6 10 7
I used the same analysis to figure out the answer for the entire deck.
I used H = Hearts, D = Diamonds, C = Clubs, and S = Spades.
The order would be:
A H
A D
2 H
A C
3 H
2 D
4 H
Q C
5 H
3 D
6 H
2 C
7 H
4 D
8 H
8 C
9 H
5 D
10 H
3 C
J H
6 D
Q H
J C
K H
7 D
A S
4 C
2 S
8 D
3 S
9 C
4 S
9 D
5 S
5 C
6 S
10 D
7 S
K C
8 S
J D
9 S
6 C
10 S
Q D
J S
10 C
Q S
K D
K S
7 C
Back to the Card Trick