You may just want to continue the sequence from sample, for me it was enough to get it for n = 5
{ 1, 3, 2, 6, 8, 4, 11, 5 } to start noticing the pattern.
Alternatively, just plug it into OEIS and come across A019444 with an explanation how to compute the answer :D