login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A246866 Bitmasks that can be used to generate a sequence of all positive integers up to 2^n. 0
3, 6, 12, 20, 48, 96, 184, 272, 576, 1280, 3232, 6912, 13568, 24576, 46080, 73728, 132096, 466944, 589824, 1310720, 3145728, 4194304, 14155776, 18874368, 59244544, 119537664, 150994944, 335544320, 847249408, 1207959552, 2734686208 (list; graph; refs; listen; history; text; internal format)
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)
CROSSREFS
Sequence in context: A028924 A034738 A054064 * A053479 A290768 A070333
KEYWORD
more,nonn
AUTHOR
James Nylen, Sep 05 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 13:50 EDT 2024. Contains 371780 sequences. (Running on oeis4.)