OFFSET
0,4
LINKS
FORMULA
EXAMPLE
The top left [0 .. 16] x [0 .. 19] section of the array:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
0, 1, 3, 6, 2, 12, 4, 7, 5, 24, 8, 11, 9, 13, 15, 10, 14, 48, 16, 19
0, 1, 3, 2, 7, 6, 13, 12, 5, 4, 25, 24, 9, 8, 15, 14, 11, 10, 49, 48
0, 1, 3, 2, 6, 5, 7, 15, 13, 4, 12, 27, 25, 8, 24, 14, 10, 9, 11, 51
0, 1, 3, 2, 6, 7, 4, 5, 14, 15, 12, 13, 26, 27, 24, 25, 10, 11, 8, 9
0, 1, 3, 2, 6, 7, 5, 12, 4, 10, 14, 13, 15, 30, 26, 25, 27, 11, 9, 24
0, 1, 3, 2, 6, 7, 5, 4, 13, 12, 11, 10, 15, 14, 31, 30, 27, 26, 9, 8
0, 1, 3, 2, 6, 7, 5, 4, 12, 15, 13, 9, 11, 14, 10, 29, 31, 26, 30, 8
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 14, 15, 8, 9, 10, 11, 28, 29, 30, 31
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 10, 14, 24, 8, 11, 9, 20, 28, 31
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 11, 10, 25, 24, 9, 8, 21, 20
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 9, 11, 27, 25, 8, 24, 23
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 8, 9, 26, 27, 24, 25
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 24, 8, 30, 26, 25
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8, 25, 24, 31, 30
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8, 24, 27, 25, 29
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 15, 14, 10, 11, 9, 8, 24, 25, 26, 27
MATHEMATICA
PROG
(Scheme)
(define (A268820bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (A268717 (+ 1 (A268820bi (- row 1) (- col 1)))))))
(define (A268820bi row col) (cond ((zero? row) col) ((zero? col) 0) (else (A003188 (+ 1 (A006068 (A268820bi (- row 1) (- col 1))))))))
(PARI) A003188(n) = bitxor(n, n\2);
for(r=0, 15, for(c=0, r, print1(a(c, r - c), ", "); ); print(); ); \\ Indranil Ghosh, Apr 02 2017
(Python)
def A003188(n): return n^(n//2)
def A006068(n):
if n<2: return n
else:
m=A006068(n//2)
return 2*m + (n%2 + m%2)%2
for r in range(16):
print([a(c, r - c) for c in range(r + 1)]) # Indranil Ghosh, Apr 02 2017
CROSSREFS
Inverses of these permutations can be found in table A268830.
Row 0: A001477, Row 1: A268717, Row 2: A268821, Row 3: A268823, Row 4: A268825, Row 5: A268827, Row 6: A268831, Row 7: A268933.
Rows converge towards A003188, which is also the main diagonal.
Cf. array A268715 (can be extracted from this one).
Cf. array A268833 (shows related Hamming distances with regular patterns).
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Feb 14 2016
STATUS
approved