OFFSET
0,2
COMMENTS
A 2n-bit binary number can be reversed by multiplying it first by 2 and the n-th element of this sequence, masking it (bit and) with n-th element of A036214 and taking remainder of the division by (2^(2n + 2) - 1).
REFERENCES
R. Schroeppel: DECsystem-10/20 Processor Reference Manual AA-H391A-TK, Chapter 2, User Operations, section 2.15: Programming Examples: Reversing Order of Digits.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..40
M. Beeler, R. W. Gosper, and R. Schroeppel, A Bit-Reversing Example in HAKMEM (Item 167).
A. Karttunen, A Simple C program Demonstrating Bit Reversals.
FORMULA
a(0) = 1, a(n) = (2^(2*n^2+2*n)-1) / (2^(2*n)-1).
MATHEMATICA
Join[{1}, Table[((2^((2 (n^2)) + 2 (n))) - 1) / ((2^(2 n)) - 1), {n, 20}]] (* Vincenzo Librandi, Aug 03 2017 *)
PROG
(PARI) a(n) = if (n==0, 1, ((2^((2*(n^2))+2*(n)))-1)/((2^(2*n))-1)) \\ Michel Marcus, Jun 07 2013
(Magma) [1] cat [((2^((2*(n^2))+2*(n)))-1)/((2^(2*n))-1): n in [1..10]]; // Vincenzo Librandi, Aug 03 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved