This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A066321 #56 Jan 19 2021 21:14:23 %S A066321 0,1,12,13,464,465,476,477,448,449,460,461,272,273,284,285,256,257, %T A066321 268,269,3280,3281,3292,3293,3264,3265,3276,3277,3088,3089,3100,3101, %U A066321 3072,3073,3084,3085,3536,3537,3548,3549,3520,3521,3532,3533,3344,3345,3356 %N A066321 Binary representation of base-(i-1) expansion of n: replace i-1 with 2 in base-(i-1) expansion of n. %C A066321 Here i = sqrt(-1). %C A066321 First differences follow a strange period-16 pattern: 1 11 1 XXX 1 11 1 -29 1 11 1 -189 1 11 1 -29 where XXX is given by A066322. Number of one-bits is A066323. %C A066321 From _Andrey Zabolotskiy_, Feb 06 2017: (Start) %C A066321 (Observations.) %C A066321 Actually, the sequence of the first differences can be split into blocks of size of any power of 2, and there will be only one position in the block that does not repeat. In this sense, one may say that the first differences follow (almost-)period-2^s pattern for any s > 0. %C A066321 Specifically, the first differences are given by the formula: a(n+1)-a(n) = A282137(A007814((n xor ...110011001100) + 1)). Here binary representation of n is bitwise-xored with the period-4 bit sequence (A021913 written right-to-left) which is infinite or simply long enough; A007814(m) does not depend on the bits of m other than the least significant 1. %C A066321 A282137 gives all first differences in the order of decreasing occurrence frequency. %C A066321 (End) %C A066321 Penney shows that since (i-1)^4 = -4, the representation a(n) of a real integer n is found by writing n in base -4 using digits 0 to 3 (A007608), changing those digits to bit strings 0000, 0001, 1100, 1101 respectively, and interpreting as binary. - _Kevin Ryde_, Sep 07 2019 %D A066321 D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 172. (See also exercise 16, p. 177; answer, p. 494.) %H A066321 Paul Tek, <a href="/A066321/b066321.txt">Table of n, a(n) for n = 0..10000</a> %H A066321 Joerg Arndt, <a href="https://jjj.de/fxt/demo/bits/index.html#radix-m1pi">The fxt demos: bit wizardry, radix(-1+i)</a>, C++ radix-m1pi.h function bin_real_to_radm1pi(). %H A066321 Solomon I. Khmelnik, <a href="http://lib.izdatelstwo.com/Papers2/s4.djvu">Specialized Digital Computer for Operations with Complex Numbers</a>, Questions of Radio Electronics, 12 (1964), 60-82 [in Russian]. %H A066321 W. J. Penney, <a href="http://dx.doi.org/10.1145/321264.321274">A "binary" system for complex numbers</a>, JACM 12 (1965), 247-248. %H A066321 N. J. A. Sloane, <a href="/A066321/a066321.txt">Table of n, (I-1)^n for n = 0..100</a> %H A066321 Paul Tek, <a href="/A066321/a066321.pl.txt">Perl program for this sequence</a> %H A066321 Andrey Zabolotskiy, <a href="http://pastebin.com/uHJW13zf">negation & addition of Gaussian integers written in base i-1</a> [Python script]. %F A066321 In "rebase notation" a(n) = (i-1)[n]2. %F A066321 G.f. g(z) satisfies g(z) = z*(1+12*z+13*z^2)/(1-z^4) + 16*z^4*(13+12*z^4+z^8)/((1-z)*(1+z^4)*(1+z^8)) + 256*(1-z^16)*g(z^16)/(z^12-z^13). - _Robert Israel_, Oct 21 2016 %e A066321 a(4) = 464 = 2^8 + 2^7 + 2^6 + 2^4 since (i-1)^8 + (i-1)^7 + (i-1)^6 + (i-1)^4 = 4. %p A066321 f:= proc(n) option remember; local t,m; %p A066321 t:= n mod 4; %p A066321 procname(t) + 16*procname((t-n)/4) %p A066321 end proc: %p A066321 f(0):= 0: f(1):= 1: f(2):= 12: f(3):= 13: %p A066321 seq(f(i),i=0..100); # _Robert Israel_, Oct 21 2016 %o A066321 (Perl) See Links section. %o A066321 (Python) %o A066321 from gmpy2 import c_divmod %o A066321 u = ('0000','1000','0011','1011') %o A066321 def A066321(n): %o A066321 if n == 0: %o A066321 return 0 %o A066321 else: %o A066321 s, q = '', n %o A066321 while q: %o A066321 q, r = c_divmod(q, -4) %o A066321 s += u[r] %o A066321 return int(s[::-1],2) # _Chai Wah Wu_, Apr 09 2016 %o A066321 (PARI) a(n) = my(ret=0,p=0); while(n, ret+=[0,1,12,13][n%4+1]<<p; n\=-4;p+=4); ret; \\ _Kevin Ryde_, Sep 07 2019 %Y A066321 Cf. A066322, A066323, A282137. %Y A066321 See A271472 for the conversion of these decimal numbers to binary. %Y A066321 See A009116 and A009545 for real and imaginary parts of (i-1)^n (except for signs). %Y A066321 See A256441 for expansions of -n. %K A066321 base,easy,nonn %O A066321 0,3 %A A066321 _Marc LeBrun_, Dec 14 2001