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.

A295989 Irregular triangle T(n, k), read by rows, n >= 0 and 0 <= k < A001316(n): T(n, k) is the (k+1)-th nonnegative number m such that n AND m = m (where AND denotes the bitwise AND operator).

This page as a plain text file.
%I A295989 #32 Feb 24 2024 20:59:41
%S A295989 0,0,1,0,2,0,1,2,3,0,4,0,1,4,5,0,2,4,6,0,1,2,3,4,5,6,7,0,8,0,1,8,9,0,
%T A295989 2,8,10,0,1,2,3,8,9,10,11,0,4,8,12,0,1,4,5,8,9,12,13,0,2,4,6,8,10,12,
%U A295989 14,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0
%N A295989 Irregular triangle T(n, k), read by rows, n >= 0 and 0 <= k < A001316(n): T(n, k) is the (k+1)-th nonnegative number m such that n AND m = m (where AND denotes the bitwise AND operator).
%C A295989 The (n+1)-th row has A001316(n) terms and sums to n * A001316(n) / 2.
%C A295989 For any n >= 0 and k such that 0 <= k < A001316(n):
%C A295989 - if A000120(n) > 0 then T(n, 1) = A006519(n),
%C A295989 - if A000120(n) > 1 then T(n, 2) = 2^A285099(n),
%C A295989 - if A000120(n) > 0 then T(n, A001316(n)/2 - 1) = A053645(n),
%C A295989 - if A000120(n) > 0 then T(n, A001316(n)/2) = 2^A000523(n),
%C A295989 - if A000120(n) > 0 then T(n, A001316(n) - 2) = A129760(n),
%C A295989 - T(n, A001316(n) - 1) = n,
%C A295989 - 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,
%C A295989 - T(n, k) AND T(n, A001316(n) - k - 1) = 0,
%C A295989 - T(n, k) + T(n, A001316(n) - k - 1) = n,
%C A295989 - T(n, k) = k for any k < A006519(n+1),
%C A295989 - A000120(T(n, k)) = A000120(k).
%C A295989 If we plot (n, T(n,k)) then we obtain a skewed Sierpinski triangle (see Links section).
%C A295989 If interpreted as a flat sequence a(n) for n >= 0:
%C A295989 - a(n) = 0 iff n = A006046(k) for some k >= 0,
%C A295989 - a(n) = 1 iff n = A006046(2*k + 1) + 1 for some k >= 0,
%C A295989 - a(A006046(k) - 1) = k - 1 for any k > 0.
%H A295989 Rémy Sigrist, <a href="/A295989/b295989.txt">Rows n = 0..256, flattened</a>
%H A295989 Rémy Sigrist, <a href="/A295989/a295989.png">Scatterplot of (n, T(n, k)) for n = 0..1023 and k = 0..A001316(n)-1</a>
%F A295989 For any n >= 0 and k such that 0 <= k < A001316(n):
%F A295989 - T(n, 0) = 0,
%F A295989 - T(2*n, k) = 2*T(n, k),
%F A295989 - T(2*n+1, 2*k) = 2*T(n, k),
%F A295989 - T(2*n+1, 2*k+1) = 2*T(n, k) + 1.
%e A295989 Triangle begins:
%e A295989   0:   [0]
%e A295989   1:   [0, 1]
%e A295989   2:   [0, 2]
%e A295989   3:   [0, 1, 2, 3]
%e A295989   4:   [0, 4]
%e A295989   5:   [0, 1, 4, 5]
%e A295989   6:   [0, 2, 4, 6]
%e A295989   7:   [0, 1, 2, 3, 4, 5, 6, 7]
%e A295989   8:   [0, 8]
%e A295989   9:   [0, 1, 8, 9]
%e A295989   10:  [0, 2, 8, 10]
%e A295989   11:  [0, 1, 2, 3, 8, 9, 10, 11]
%e A295989   12:  [0, 4, 8, 12]
%e A295989   13:  [0, 1, 4, 5, 8, 9, 12, 13]
%e A295989   14:  [0, 2, 4, 6, 8, 10, 12, 14]
%e A295989   15:  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
%t A295989 A295989row[n_] := Select[Range[0, n], BitAnd[#, n-#] == 0 &];
%t A295989 Array[A295989row, 25, 0] (* _Paolo Xausa_, Feb 24 2024 *)
%o A295989 (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)
%Y A295989 Cf. A000120, A000523, A001316 (row lengths), A006046, A006519, A053645, A129760, A285099.
%Y A295989 First column of array in A352909.
%K A295989 nonn,tabf,look,base
%O A295989 0,5
%A A295989 _Rémy Sigrist_, Dec 02 2017