OFFSET
2,1
COMMENTS
The sequence skips around in a simple pseudo-random order hitting each number from 1 to 2^n exactly once, which makes it suitable for use in e.g. a dissolve-style pixel graphics effect.
JavaScript code to generate all numbers from 1 to 2^n using XOR_MASK, an element of this sequence:
var i = 1; do { i = (i >> 1) ^ (i & 1 ? XOR_MASK : 0); } while (i != 1);
First few numbers of this sequence in hexadecimal, for searchability: 0x03, 0x06, 0x0C, 0x14, 0x30, 0x60, 0xB8, 0x0110, 0x0240, ...
REFERENCES
Andrew S. Glassner, Graphics Gems, Academic Press, 1990, pages 221-232.
LINKS
Mactech.com, Source code for old Macintosh project (see dissMask.c)
Ticalc.org, Source code for TI-89 project (see file dissolve.c)
Ticalc.org, TI-89 project programmer's project page
CROSSREFS
KEYWORD
more,nonn
AUTHOR
James Nylen, Sep 05 2014
STATUS
approved