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.

A163235 Two-dimensional Binary Reflected Gray Code, transposed version: a(i,j) = bits of binary expansion of A003188(j) interleaved with that of A003188(i).

Original entry on oeis.org

0, 2, 1, 10, 3, 5, 8, 11, 7, 4, 40, 9, 15, 6, 20, 42, 41, 13, 14, 22, 21, 34, 43, 45, 12, 30, 23, 17, 32, 35, 47, 44, 28, 31, 19, 16, 160, 33, 39, 46, 60, 29, 27, 18, 80, 162, 161, 37, 38, 62, 61, 25, 26, 82, 81, 170, 163, 165, 36, 54, 63, 57, 24, 90, 83, 85, 168, 171, 167
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

The top left 8x8 corner of this array
+0 +2 10 +8 40 42 34 32
+1 +3 11 +9 41 43 35 33
+5 +7 15 13 45 47 39 37
+4 +6 14 12 44 46 38 36
20 22 30 28 60 62 54 52
21 23 31 29 61 63 55 53
17 19 27 25 57 59 51 49
16 18 26 24 56 58 50 48
corresponds with Adamson's "H-bond codon-anticodon magic square" (see page 287 in Pickover's book):
CCC CCU CUU CUC UUC UUU UCU UCC
CCA CCG CUG CUA UUA UUG UCG UCA
CAA CAG CGG CGA UGA UGG UAG UAA
CAC CAU CGU CGC UGC UGU UAU UAC
AAC AAU AGU AGC GGC GGU GAU GAC
AAA AAG AGG AGA GGA GGG GAG GAA
ACA ACG AUG AUA GUA GUG GCG GCA
ACC ACU AUU AUC GUC GUU GCU GCC
when the base-triples are interpreted as quaternary (base-4) numbers, with the following rules: C = 0, A = 1, U = 2, G = 3.

References

  • Clifford A. Pickover, The Zen of Magic Squares, Circles, and Stars: An Exhibition of Surprising Structures across Dimensions, Princeton University Press, 2002, pp. 285-289.

Crossrefs

Inverse: A163236. a(n) = A057300(A163233(n)). Transpose: A163233. Row sums: A163242. Cf. A054238, A147995.

Programs

  • Mathematica
    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, 0, i}] // Flatten (* Michael De Vlieger, Jun 25 2017 *)
  • Python
    def a000695(n):
        n=bin(n)[2:]
        x=len(n)
        return sum(int(n[i])*4**(x - 1 - i) for i in range(x))
    def a003188(n): return n^(n>>1)
    def a(n, k): return a000695(a003188(n)) + 2*a000695(a003188(k))
    for n in range(21): print([a(k, n - k) for k in range(n + 1)]) # Indranil Ghosh, Jun 25 2017
  • Scheme
    (define (A163235 n) (A163233bi (A002262 n) (A025581 n)))