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.

A309576 Table read by rows: T(n, k) is the last k bits of n interpreted as a base-2 representation of a number and converted to decimal, 0 <= k <= A070939(n).

This page as a plain text file.
%I A309576 #21 Oct 08 2019 20:05:00
%S A309576 0,1,0,0,2,0,1,3,0,0,0,4,0,1,1,5,0,0,2,6,0,1,3,7,0,0,0,0,8,0,1,1,1,9,
%T A309576 0,0,2,2,10,0,1,3,3,11,0,0,0,4,12,0,1,1,5,13,0,0,2,6,14,0,1,3,7,15,0,
%U A309576 0,0,0,0,16,0,1,1,1,1,17,0,0,2,2,2,18,0,1
%N A309576 Table read by rows: T(n, k) is the last k bits of n interpreted as a base-2 representation of a number and converted to decimal, 0 <= k <= A070939(n).
%H A309576 Peter Kagey, <a href="/A309576/b309576.txt">Table of n, a(n) for n = 1..9987</a> (first 1000 rows)
%F A309576 T(n,0) = 0 and T(n, A070939(n)) = n.
%e A309576 For n = 26 and k = 3, T(26, 3) = 2 because 26 = 11010_2, and looking at only the last three bits gives 010_2 = 2.
%e A309576 Table begins:
%e A309576   n\k| 0 1 2 3 4
%e A309576   ---+-----------
%e A309576    1 | 0 1
%e A309576    2 | 0 0 2
%e A309576    3 | 0 1 3
%e A309576    4 | 0 0 0 4
%e A309576    5 | 0 1 1 5
%e A309576    6 | 0 0 2 6
%e A309576    7 | 0 1 3 7
%e A309576    8 | 0 0 0 0 8
%e A309576    9 | 0 1 1 1 9
%t A309576 T[n_, k_] := BitAnd[n, 2^k-1]; Table[T[n, k], {n, 1, 20}, {k, 0, BitLength[n]}] // Flatten (* _Amiram Eldar_, Aug 09 2019 *)
%o A309576 (Ruby)
%o A309576 def t(n,k); n & (1 << k) - 1 end
%Y A309576 Cf. A070939, A309577.
%K A309576 nonn,tabf,base,look
%O A309576 1,5
%A A309576 _Peter Kagey_, Aug 08 2019