cp's OEIS Frontend

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.

A014550 Binary reflected Gray code.

This page as a plain text file.
%I A014550 #37 Apr 30 2025 11:09:15
%S A014550 0,1,11,10,110,111,101,100,1100,1101,1111,1110,1010,1011,1001,1000,
%T A014550 11000,11001,11011,11010,11110,11111,11101,11100,10100,10101,10111,
%U A014550 10110,10010,10011,10001,10000,110000,110001,110011,110010,110110
%N A014550 Binary reflected Gray code.
%D A014550 M. Gardner, The Binary Gray Code. Ch. 2 in Knotted Doughnuts and Other Mathematical Entertainments. New York: W. H. Freeman, 1986.
%D A014550 C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 392.
%H A014550 Alois P. Heinz, <a href="/A014550/b014550.txt">Table of n, a(n) for n = 0..8191</a>
%H A014550 Dominique Désérable, <a href="https://doi.org/10.1007/978-3-031-78757-7_6">Versatile Topology for Two-Dimensional Cellular Automata</a>, Advances in Cellular Automata, Emergence, Complexity and Computation (ECC Vol 52) Springer, Cham (2025), Ch. 6, pp. 151-186.
%H A014550 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GrayCode.html">Gray Code</a>
%H A014550 Wikipedia, <a href="https://en.wikipedia.org/wiki/Gray_code">Gray code</a>
%p A014550 a:= proc(n) option remember; `if`(n<2, n,
%p A014550       (b-> 10^b +a(2^(b+1)-1-n))(ilog2(n)))
%p A014550     end:
%p A014550 seq(a(n), n=0..50);  # _Alois P. Heinz_, Nov 01 2008
%t A014550 a[n_] := a[n] = (b = Floor[Log[2, n]]; If[n <= 1, n, 10^b + a[2^(b + 1) - 1 - n]]); Table[a[n], {n, 0, 36}] (* _Jean-François Alcover_, Oct 11 2012, after _Alois P. Heinz_ *)
%o A014550 (PARI) a(n)=fromdigits(binary(bitxor(n, n>>1))) \\ _Charles R Greathouse IV_, Feb 06 2017
%o A014550 (Python)
%o A014550 def A014550(n): return int(bin(n^n>>1)[2:]) # _Chai Wah Wu_, May 31 2024
%Y A014550 Same sequence in decimal: A003188.
%K A014550 nonn,nice,easy
%O A014550 0,3
%A A014550 _Eric W. Weisstein_
%E A014550 More terms from Larry Reeves (Larryr(AT)acm.org), Sep 05 2000