login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 2
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, 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, 0, 0, 0, 0, 16, 0, 1, 1, 1, 1, 17, 0, 0, 2, 2, 2, 18, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

LINKS

Peter Kagey, Table of n, a(n) for n = 1..9987 (first 1000 rows)

FORMULA

T(n,0) = 0 and T(n, A070939(n)) = n.

EXAMPLE

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.

Table begins:

  n\k| 0 1 2 3 4

  ---+-----------

   1 | 0 1

   2 | 0 0 2

   3 | 0 1 3

   4 | 0 0 0 4

   5 | 0 1 1 5

   6 | 0 0 2 6

   7 | 0 1 3 7

   8 | 0 0 0 0 8

   9 | 0 1 1 1 9

MATHEMATICA

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 *)

PROG

(Ruby)

def t(n, k); n & (1 << k) - 1 end

CROSSREFS

Cf. A070939, A309577.

Sequence in context: A210572 A085855 A280500 * A128132 A158821 A127701

Adjacent sequences:  A309573 A309574 A309575 * A309577 A309578 A309579

KEYWORD

nonn,tabf,base,look

AUTHOR

Peter Kagey, Aug 08 2019

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 13 07:45 EDT 2021. Contains 344981 sequences. (Running on oeis4.)