OFFSET
0,4
LINKS
FORMULA
EXAMPLE
The top left [0 .. 15] x [0 .. 15] section of the array:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
1, 3, 6, 2, 12, 4, 7, 5, 24, 8, 11, 9, 13, 15, 10, 14
2, 6, 5, 7, 15, 13, 4, 12, 27, 25, 8, 24, 14, 10, 9, 11
3, 2, 7, 6, 13, 12, 5, 4, 25, 24, 9, 8, 15, 14, 11, 10
4, 12, 15, 13, 9, 11, 14, 10, 29, 31, 26, 30, 8, 24, 27, 25
5, 4, 13, 12, 11, 10, 15, 14, 31, 30, 27, 26, 9, 8, 25, 24
6, 7, 4, 5, 14, 15, 12, 13, 26, 27, 24, 25, 10, 11, 8, 9
7, 5, 12, 4, 10, 14, 13, 15, 30, 26, 25, 27, 11, 9, 24, 8
8, 24, 27, 25, 29, 31, 26, 30, 17, 19, 22, 18, 28, 20, 23, 21
9, 8, 25, 24, 31, 30, 27, 26, 19, 18, 23, 22, 29, 28, 21, 20
10, 11, 8, 9, 26, 27, 24, 25, 22, 23, 20, 21, 30, 31, 28, 29
11, 9, 24, 8, 30, 26, 25, 27, 18, 22, 21, 23, 31, 29, 20, 28
12, 13, 14, 15, 8, 9, 10, 11, 28, 29, 30, 31, 24, 25, 26, 27
13, 15, 10, 14, 24, 8, 11, 9, 20, 28, 31, 29, 25, 27, 30, 26
14, 10, 9, 11, 27, 25, 8, 24, 23, 21, 28, 20, 26, 30, 29, 31
15, 14, 11, 10, 25, 24, 9, 8, 21, 20, 29, 28, 27, 26, 31, 30
MATHEMATICA
PROG
(Scheme)
;; Alternatively, extracting data from array A268820:
(Python)
def a003188(n): return n^(n>>1)
def a006068(n):
s=1
while True:
ns=n>>s
if ns==0: break
n=n^ns
s<<=1
return n
def T(n, k): return a003188(a006068(n) + a006068(k))
for n in range(21): print([T(n - k, k) for k in range(n + 1)]) # Indranil Ghosh, Jun 07 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Feb 12 2016
STATUS
approved