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 A163233 #31 Jul 03 2025 20:39:34 %S A163233 0,1,2,5,3,10,4,7,11,8,20,6,15,9,40,21,22,14,13,41,42,17,23,30,12,45, %T A163233 43,34,16,19,31,28,44,47,35,32,80,18,27,29,60,46,39,33,160,81,82,26, %U A163233 25,61,62,38,37,161,162,85,83,90,24,57,63,54,36,165,163,170,84,87,91 %N A163233 Two-dimensional Binary Reflected Gray Code: a(i,j) = bits of binary expansion of A003188(i) interleaved with that of A003188(j). %C A163233 The top left 8 X 8 corner of the array is %C A163233 +0 +1 +5 +4 20 21 17 16 %C A163233 +2 +3 +7 +6 22 23 19 18 %C A163233 10 11 15 14 30 31 27 26 %C A163233 +8 +9 13 12 28 29 25 24 %C A163233 40 41 45 44 60 61 57 56 %C A163233 42 43 47 46 62 63 59 58 %C A163233 34 35 39 38 54 55 51 50 %C A163233 32 33 37 36 52 53 49 48 %C A163233 By taking the top left 2 X 2 corner, 2 X 4 rectangle ((0,1,5,4),(2,3,7,6)) or 4 X 4 corner one obtains Karnaugh map templates for 2, 3 or 4 variables respectively (although not the standard ones usually given in the textbooks). %H A163233 Antti Karttunen, <a href="/A163233/b163233.txt">Table of n, a(n) for n = 0..2079</a> %H A163233 Wikipedia, <a href="http://en.wikipedia.org/wiki/Karnaugh_map">Karnaugh map</a> %H A163233 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A163233 a(x,y) = A000695(A003188(x)) + 2*A000695(A003188(y)). %t A163233 Table[Function[k, FromDigits[#, 2] &@ Apply[Function[{a, b}, Riffle @@ Map[PadLeft[#, Max[Length /@ {a, b}]] &, {a, b}]], Map[IntegerDigits[#, 2] &@ BitXor[#, Floor[#/2]] &, {k, j}]]][i - j], {i, 0, 11}, {j, i, 0, -1}] // Flatten (* _Michael De Vlieger_, Jun 25 2017 *) %o A163233 (Scheme) (define (A163233bi x y) (+ (A000695 (A003188 x)) (* 2 (A000695 (A003188 y))))) %o A163233 (define (A163233 n) (A163233bi (A025581 n) (A002262 n))) %o A163233 (Python) %o A163233 def a000695(n): %o A163233 n=bin(n)[2:] %o A163233 x=len(n) %o A163233 return sum([int(n[i])*4**(x - 1 - i) for i in range(x)]) %o A163233 def a003188(n): return n^(n>>1) %o A163233 def a(n, k): return a000695(a003188(n)) + 2*a000695(a003188(k)) %o A163233 for n in range(21): print([a(n - k, k) for k in range(n + 1)]) # _Indranil Ghosh_, Jun 25 2017 %Y A163233 Inverse: A163234. a(n) = A057300(A163235(n)). Transpose: A163235. Row sums: A163242. Cf. A054238, A147995. %K A163233 nonn,tabl,look %O A163233 0,3 %A A163233 _Antti Karttunen_, Jul 29 2009