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.

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

This page as a plain text file.
%I A335040 #13 Feb 16 2025 08:34:00
%S A335040 0,1,2,3,4,5,6,7,8,10,12,13,14,15,16,20,24,25,26,27,28,29,30,31,32,40,
%T A335040 41,48,50,52,54,56,57,58,59,60,61,62,63,64,80,81,82,83,96,100,104,108,
%U A335040 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126
%N A335040 Numbers whose binary representation encodes a (binary) max-heap on elements from the set {0,1} with root at the most significant bit.
%H A335040 Alois P. Heinz, <a href="/A335040/b335040.txt">Table of n, a(n) for n = 1..10000</a>
%H A335040 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Heap.html">Heap</a>
%H A335040 Wikipedia, <a href="https://en.wikipedia.org/wiki/Binary_heap">Binary heap</a>
%H A335040 Wikipedia, <a href="https://en.wikipedia.org/wiki/Bit_numbering#Most_significant_bit">Most significant bit</a>
%p A335040 q:= proc(n) local i, l; l:= convert(n, base, 2);
%p A335040       for i from 2 to nops(l) do
%p A335040         if l[-i]>l[-iquo(i, 2)] then return false fi
%p A335040       od; true
%p A335040     end:
%p A335040 a:= proc(n) option remember; local k: for k from 1+
%p A335040       `if`(n=1, -1, a(n-1)) while not q(k) do od; k
%p A335040     end:
%p A335040 seq(a(n), n=1..70);
%Y A335040 Cf. A000225 (subsequence), A335039, A335041, A335042 (subsequence).
%K A335040 nonn,base
%O A335040 1,3
%A A335040 _Alois P. Heinz_, May 20 2020