OFFSET
0,4
LINKS
EXAMPLE
The top left [0 .. 15] x [0 .. 15] section of the array:
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13, 8, 9, 11, 10
1, 2, 4, 3, 8, 7, 5, 6, 16, 15, 13, 14, 9, 10, 12, 11
3, 4, 6, 5, 10, 9, 7, 8, 18, 17, 15, 16, 11, 12, 14, 13
2, 3, 5, 4, 9, 8, 6, 7, 17, 16, 14, 15, 10, 11, 13, 12
7, 8, 10, 9, 14, 13, 11, 12, 22, 21, 19, 20, 15, 16, 18, 17
6, 7, 9, 8, 13, 12, 10, 11, 21, 20, 18, 19, 14, 15, 17, 16
4, 5, 7, 6, 11, 10, 8, 9, 19, 18, 16, 17, 12, 13, 15, 14
5, 6, 8, 7, 12, 11, 9, 10, 20, 19, 17, 18, 13, 14, 16, 15
15, 16, 18, 17, 22, 21, 19, 20, 30, 29, 27, 28, 23, 24, 26, 25
14, 15, 17, 16, 21, 20, 18, 19, 29, 28, 26, 27, 22, 23, 25, 24
12, 13, 15, 14, 19, 18, 16, 17, 27, 26, 24, 25, 20, 21, 23, 22
13, 14, 16, 15, 20, 19, 17, 18, 28, 27, 25, 26, 21, 22, 24, 23
8, 9, 11, 10, 15, 14, 12, 13, 23, 22, 20, 21, 16, 17, 19, 18
9, 10, 12, 11, 16, 15, 13, 14, 24, 23, 21, 22, 17, 18, 20, 19
11, 12, 14, 13, 18, 17, 15, 16, 26, 25, 23, 24, 19, 20, 22, 21
10, 11, 13, 12, 17, 16, 14, 15, 25, 24, 22, 23, 18, 19, 21, 20
MATHEMATICA
A006068[n_] := BitXor @@ Table[Floor[n/2^m], {m, 0, Log[2, n]}]; A006068[0] = 0; A[i_, j_] := A006068[i] + A006068[j]; Table[A[i-j, j], {i, 0, 13}, {j, 0, i}] // Flatten (* Jean-François Alcover, Feb 17 2016 *)
PROG
(Scheme)
(PARI)
\\ Produces the triangle when the array is read by antidiagonals
a(n) = if(n<2, n, 2*a(floor(n/2)) + (n%2 + a(floor(n/2))%2)%2); /* A006068 */
T(i, j) = a(i) + a(j);
for(i=0, 13, for(j=0, i, print1(T(i - j, j), ", "); ); print(); ); \\ Indranil Ghosh, Mar 23 2017
(Python)
# Produces the triangle when the array is read by antidiagonals
def A006068(n):
for i in range(14):
print([T(i - j, j) for j in range(i + 1)]) # Indranil Ghosh, Mar 23 2017
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Feb 12 2016
STATUS
approved