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

%I #28 Sep 22 2014 19:55:40

%S 3,6,12,20,48,96,184,272,576,1280,3232,6912,13568,24576,46080,73728,

%T 132096,466944,589824,1310720,3145728,4194304,14155776,18874368,

%U 59244544,119537664,150994944,335544320,847249408,1207959552,2734686208

%N Bitmasks that can be used to generate a sequence of all positive integers up to 2^n.

%C 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.

%C JavaScript code to generate all numbers from 1 to 2^n using XOR_MASK, an element of this sequence:

%C var i = 1; do { i = (i >> 1) ^ (i & 1 ? XOR_MASK : 0); } while (i != 1);

%C First few numbers of this sequence in hexadecimal, for searchability: 0x03, 0x06, 0x0C, 0x14, 0x30, 0x60, 0xB8, 0x0110, 0x0240, ...

%D Andrew S. Glassner, Graphics Gems, Academic Press, 1990, pages 221-232.

%H Mactech.com, <a href="http://www.mactech.com/articles/mactech/Vol.06/06.12/SafeDissolve/index.html">Source code for old Macintosh project</a> (see dissMask.c)

%H Ticalc.org, <a href="http://www.ticalc.org/archives/files/fileinfo/137/13705.html">Source code for TI-89 project</a> (see file dissolve.c)

%H Ticalc.org, <a href="http://tict.ticalc.org/projects.html">TI-89 project programmer's project page</a>

%K more,nonn

%O 2,1

%A _James Nylen_, Sep 05 2014

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 25 12:33 EDT 2024. Contains 371969 sequences. (Running on oeis4.)