cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A330090 Inverse permutation to A330081.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 5, 7, 8, 12, 9, 13, 10, 14, 11, 15, 16, 24, 18, 26, 17, 25, 19, 27, 20, 28, 22, 30, 21, 29, 23, 31, 32, 48, 36, 52, 33, 49, 37, 53, 34, 50, 38, 54, 35, 51, 39, 55, 40, 56, 44, 60, 41, 57, 45, 61, 42, 58, 46, 62, 43, 59, 47, 63, 64, 96, 72
Offset: 0

Views

Author

Rémy Sigrist, Dec 01 2019

Keywords

Comments

If the binary expansion of n is (b(1), ..., b(w)), then the binary expansion of a(n) is (b(1), b(w), b(2), b(w-1), ...); this corresponds to a "milk shuffle".

Examples

			A330081(19) = 22, hence a(22) = 19.
		

Crossrefs

Cf. A330081.

Programs

  • PARI
    unshuffle(v) = { my (w=vector(#v), o=0, e=#v+1); for (k=1, #v, w[k]=v[if (k%2, o++, e--)]); w }
    a(n) = fromdigits(unshuffle(binary(n)), 2)