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.

A335039 Numbers whose binary representation encodes a (binary) max-heap on elements from the set {0,1} with root at the least significant bit.

Original entry on oeis.org

0, 1, 3, 5, 7, 11, 15, 19, 23, 27, 31, 37, 39, 47, 55, 63, 69, 71, 79, 87, 95, 101, 103, 111, 119, 127, 139, 143, 155, 159, 175, 191, 207, 223, 239, 255, 267, 271, 283, 287, 303, 319, 335, 351, 367, 383, 395, 399, 411, 415, 431, 447, 463, 479, 495, 511, 531
Offset: 1

Views

Author

Alois P. Heinz, May 20 2020

Keywords

Comments

All positive terms are odd.

Crossrefs

Cf. A000225 (subsequence), A335040, A335041, A335042.

Programs

  • Maple
    q:= proc(n) local i, l; l:= convert(n, base, 2);
          for i from 2 to nops(l) do
            if l[i]>l[iquo(i, 2)] then return false fi
          od; true
        end:
    a:= proc(n) option remember; local k: for k from 1+
          `if`(n=1, -1, a(n-1)) while not q(k) do od; k
        end:
    seq(a(n), n=1..59);