A340669 Permutation of the nonnegative integers formed by negation in complex base i-1.
0, 29, 58, 7, 116, 25, 14, 3, 232, 21, 50, 239, 28, 17, 6, 235, 464, 13, 42, 471, 100, 9, 478, 467, 56, 5, 34, 63, 12, 1, 470, 59, 928, 957, 26, 935, 84, 953, 942, 931, 200, 949, 18, 207, 956, 945, 934, 203, 112, 941, 10, 119, 68, 937, 126, 115, 24, 933, 2, 31
Offset: 0
Examples
For n=1506, location z(1506) = 11-35*i. Its negation is -(11-35*i) = z(29914) so a(1506) = 29914. And being self-inverse conversely a(29914) = 1506. In terms of bit flips, in the following "^^" is each 01 or 11 and F marks the bits flipped above them. n = 1506 = binary 00001 0 1 11 100 01 0 FFF^^ F ^^ FFF ^^ a(n) = 29914 = binary 11101 0 0 11 011 01 0
Links
- Kevin Ryde, Table of n, a(n) for n = 0..8192
- Joerg Arndt, The fxt demos: bit wizardry. radix(-1+i)
- Solomon I. Khmelnik, Specialized Digital Computer for Operations with Complex Numbers (in Russian), Questions of Radio Electronics, volume 12, number 2, 1964.
- Kevin Ryde, Iterations of the Dragon Curve, see index MinusNeg.
- Andrey Zabolotskiy, English translation of theorems from Khmelnik, Seqfan mailing list, September 2016.
- Andrey Zabolotskiy, Python Code by bit flips or conversion and Python Code by Khmelnik's Pi and Beta, September 2016.
Programs
-
PARI
{ a(n) = for(i=0,if(n,logint(n,2)), if(bittest(n,i), if(bittest(n,i+1), n=bitxor(n,4<
Formula
a(n) is formed by transforming n as follows. Write n in binary with four high 0-bits and consider bits from least to most significant. At a 01 pair (high 0, low 1), apply an 0<->1 flip to three bits immediately above this pair. At a 11 pair, flip one bit immediately above this pair. Repeat, each time seeking the next higher 01 or 11 pair above the bits just flipped.
Comments