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.

Showing 1-1 of 1 results.

A332011 Let k be the least positive number such that n AND floor(n/k) = 0 (where AND denotes the bitwise AND operator); a(n) = floor(n/k).

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 1, 0, 4, 4, 5, 0, 3, 2, 1, 0, 8, 8, 9, 4, 10, 10, 1, 0, 6, 6, 5, 4, 3, 2, 1, 0, 16, 16, 17, 8, 18, 18, 9, 0, 20, 20, 21, 4, 3, 2, 1, 0, 12, 12, 12, 12, 10, 10, 9, 0, 7, 6, 5, 4, 3, 2, 1, 0, 32, 32, 33, 16, 34, 34, 17, 8, 36, 36, 37, 4, 19, 2
Offset: 0

Views

Author

Rémy Sigrist, Feb 04 2020

Keywords

Examples

			For n = 3:
- 3 AND floor(3/1) = 3,
- 3 AND floor(3/2) = 1,
- 3 AND floor(3/3) = 1,
- 3 AND floor(3/4) = 0,
- hence a(3) = floor(3/4) = 0.
		

Crossrefs

Programs

  • PARI
    a(n) = for (k=1, oo, if (bitand(n, n\k)==0, return (n\k)))

Formula

a(n) = floor(n/A331985(n)).
Apparently, a(n) = 0 iff n = 0 or n belongs to A112714.
Showing 1-1 of 1 results.