OFFSET
0,5
COMMENTS
For any n >= 0 and k such that 0 <= k < A001316(n):
- T(n, A001316(n) - 1) = n,
- the six previous relations correspond respectively (when applicable) to the second term, the third term, the pair of central terms, the penultimate term and the last term of a row,
- T(n, k) AND T(n, A001316(n) - k - 1) = 0,
- T(n, k) + T(n, A001316(n) - k - 1) = n,
- T(n, k) = k for any k < A006519(n+1),
If we plot (n, T(n,k)) then we obtain a skewed Sierpinski triangle (see Links section).
If interpreted as a flat sequence a(n) for n >= 0:
- a(n) = 0 iff n = A006046(k) for some k >= 0,
- a(n) = 1 iff n = A006046(2*k + 1) + 1 for some k >= 0,
- a(A006046(k) - 1) = k - 1 for any k > 0.
LINKS
Rémy Sigrist, Rows n = 0..256, flattened
FORMULA
For any n >= 0 and k such that 0 <= k < A001316(n):
- T(n, 0) = 0,
- T(2*n, k) = 2*T(n, k),
- T(2*n+1, 2*k) = 2*T(n, k),
- T(2*n+1, 2*k+1) = 2*T(n, k) + 1.
EXAMPLE
Triangle begins:
0: [0]
1: [0, 1]
2: [0, 2]
3: [0, 1, 2, 3]
4: [0, 4]
5: [0, 1, 4, 5]
6: [0, 2, 4, 6]
7: [0, 1, 2, 3, 4, 5, 6, 7]
8: [0, 8]
9: [0, 1, 8, 9]
10: [0, 2, 8, 10]
11: [0, 1, 2, 3, 8, 9, 10, 11]
12: [0, 4, 8, 12]
13: [0, 1, 4, 5, 8, 9, 12, 13]
14: [0, 2, 4, 6, 8, 10, 12, 14]
15: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
MATHEMATICA
A295989row[n_] := Select[Range[0, n], BitAnd[#, n-#] == 0 &];
Array[A295989row, 25, 0] (* Paolo Xausa, Feb 24 2024 *)
PROG
(PARI) T(n, k) = if (k==0, 0, n%2==0, 2*T(n\2, k), k%2==0, 2*T(n\2, k\2), 2*T(n\2, k\2)+1)
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Dec 02 2017
STATUS
approved