Hi,

Not sure if you all want a long backstory so I'll skip it unless you ask. Short version:

I need to generate this sequence

1, 16, 8, 9, 4, 13, 5, 12, 2, 15, 7, 10, 3, 14, 6, 11

And I found this page

A131271 - OEIS

But when I looked at the formula

a(n, 2k-1) = a(n-1, k), if we order the 2^n first integers a(n, 2k) = 2^n + 1 - a(n, 2k-1)

I was totally baffled. I have written some computer code for formula I don't understand before but here I have no idea where to start.

For example, if I want to order the first 2^3 (8) integers I know that I need to plug 8 in as the n value...but what is the meaning of k...

Sorry for the long post.

tl;dr

To which forum should I post questions about this formula

a(n, 2k-1) = a(n-1, k), if we order the 2^n first integers a(n, 2k) = 2^n + 1 - a(n, 2k-1)

?

Cheers

Rusell