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.

A086772 Store the natural numbers in a triangular array such that values on each row have the same number of bits. Start a new row with the smallest number not yet recorded. a(n) represents the initial terms in the resulting array.

This page as a plain text file.
%I A086772 #19 Mar 03 2023 20:32:34
%S A086772 0,1,3,4,7,9,15,21,24,31,41,45,63,64,72,74,83,94,127,139,140,173,197,
%T A086772 207,234,255,268,284,288,339,349,390,426,445,467,511,522,553,569,634,
%U A086772 689,706,734,797,838,934,950,951,1023,1036,1052,1078,1179,1236
%N A086772 Store the natural numbers in a triangular array such that values on each row have the same number of bits. Start a new row with the smallest number not yet recorded. a(n) represents the initial terms in the resulting array.
%C A086772 A067576 describes the sequences with a fixed number of binary bits using antidiagonals.
%H A086772 Alois P. Heinz, <a href="/A086772/b086772.txt">Table of n, a(n) for n = 0..10000</a>
%e A086772 The array begins:
%e A086772    0
%e A086772    1  2
%e A086772    3  5  6
%e A086772    4  8 16 32
%e A086772    7 11 13 14 19
%e A086772    9 10 12 17 18 20
%e A086772   15 23 27 29 30 39 43
%e A086772   ...
%e A086772 so the initial terms are 0 1 3 4 7 9 15 ...
%p A086772 A086772aux := proc(n,k)
%p A086772     option remember;
%p A086772     local a,npr,kpr,fnd ;
%p A086772     if n = 0 then
%p A086772         return 0;
%p A086772     end if;
%p A086772     if k = 0 then
%p A086772         for a from 1 do
%p A086772             fnd := false;
%p A086772             for npr from 1 to n-1 do
%p A086772                 for kpr from 0 to npr do
%p A086772                     if procname(npr,kpr) = a then
%p A086772                         fnd := true;
%p A086772                         break;
%p A086772                     end if;
%p A086772                 end do:
%p A086772             end do:
%p A086772             if not fnd then
%p A086772                 return a;
%p A086772             end if;
%p A086772         end do:
%p A086772     else
%p A086772         for a from 1 do
%p A086772             if wt(a) = wt(procname(n,0)) then
%p A086772                 fnd := false;
%p A086772                 for npr from 1 to n-1 do
%p A086772                     for kpr from 0 to npr do
%p A086772                         if procname(npr,kpr) = a then
%p A086772                             fnd := true;
%p A086772                             break;
%p A086772                         end if;
%p A086772                     end do:
%p A086772                 end do:
%p A086772                 for kpr from 0 to k-1 do
%p A086772                     if procname(n,kpr) = a then
%p A086772                         fnd := true;
%p A086772                         break;
%p A086772                     end if;
%p A086772                 end do:
%p A086772                 if not fnd then
%p A086772                     return a;
%p A086772                 end if;
%p A086772             end if;
%p A086772         end do:
%p A086772     end if;
%p A086772 end proc:
%p A086772 A086772 := proc(n)
%p A086772     A086772aux(n,0) ;
%p A086772 end proc: # _R. J. Mathar_, Sep 15 2012
%Y A086772 Cf. A000079, A001477, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691.
%K A086772 nonn,base
%O A086772 0,3
%A A086772 _Alford Arnold_, Aug 03 2003