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!)
A309577 Table read by rows: T(n, k) is n with the first k bits removed from its binary expansion and then converted back to decimal, for 0 <= k <= A070939(n). 2
1, 0, 2, 0, 0, 3, 1, 0, 4, 0, 0, 0, 5, 1, 1, 0, 6, 2, 0, 0, 7, 3, 1, 0, 8, 0, 0, 0, 0, 9, 1, 1, 1, 0, 10, 2, 2, 0, 0, 11, 3, 3, 1, 0, 12, 4, 0, 0, 0, 13, 5, 1, 1, 0, 14, 6, 2, 0, 0, 15, 7, 3, 1, 0, 16, 0, 0, 0, 0, 0, 17, 1, 1, 1, 1, 0, 18, 2, 2, 2, 0, 0, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

LINKS

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

FORMULA

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

EXAMPLE

For n = 26 and k = 2, T(26, 2) = 2 because 26 = 11010_2, and removing the first two bits leaves 010_2 = 2.

Table begins:

  n\k| 0 1 2 3 4

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

   1 | 1 0

   2 | 2 0 0

   3 | 3 1 0

   4 | 4 0 0 0

   5 | 5 1 1 0

   6 | 6 2 0 0

   7 | 7 3 1 0

   8 | 8 0 0 0 0

   9 | 9 1 1 1 0

MATHEMATICA

T[n_, k_] := BitAnd[n, 2^k-1]; Table[T[n, k], {n, 1, 20}, {k, BitLength[n], 0, -1}] // Flatten (* Amiram Eldar, Aug 09 2019 *)

PROG

(Ruby)

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

CROSSREFS

Cf. A070939, A309576.

Sequence in context: A323592 A170980 A330369 * A029301 A263414 A162934

Adjacent sequences:  A309574 A309575 A309576 * A309578 A309579 A309580

KEYWORD

nonn,tabf,base

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 September 27 19:34 EDT 2021. Contains 347694 sequences. (Running on oeis4.)