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.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 15, 21, 24, 31, 41, 45, 63, 64, 72, 74, 83, 94, 127, 139, 140, 173, 197, 207, 234, 255, 268, 284, 288, 339, 349, 390, 426, 445, 467, 511, 522, 553, 569, 634, 689, 706, 734, 797, 838, 934, 950, 951, 1023, 1036, 1052, 1078, 1179, 1236
Offset: 0

Views

Author

Alford Arnold, Aug 03 2003

Keywords

Comments

A067576 describes the sequences with a fixed number of binary bits using antidiagonals.

Examples

			The array begins:
   0
   1  2
   3  5  6
   4  8 16 32
   7 11 13 14 19
   9 10 12 17 18 20
  15 23 27 29 30 39 43
  ...
so the initial terms are 0 1 3 4 7 9 15 ...
		

Crossrefs

Programs

  • Maple
    A086772aux := proc(n,k)
        option remember;
        local a,npr,kpr,fnd ;
        if n = 0 then
            return 0;
        end if;
        if k = 0 then
            for a from 1 do
                fnd := false;
                for npr from 1 to n-1 do
                    for kpr from 0 to npr do
                        if procname(npr,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                end do:
                if not fnd then
                    return a;
                end if;
            end do:
        else
            for a from 1 do
                if wt(a) = wt(procname(n,0)) then
                    fnd := false;
                    for npr from 1 to n-1 do
                        for kpr from 0 to npr do
                            if procname(npr,kpr) = a then
                                fnd := true;
                                break;
                            end if;
                        end do:
                    end do:
                    for kpr from 0 to k-1 do
                        if procname(n,kpr) = a then
                            fnd := true;
                            break;
                        end if;
                    end do:
                    if not fnd then
                        return a;
                    end if;
                end if;
            end do:
        end if;
    end proc:
    A086772 := proc(n)
        A086772aux(n,0) ;
    end proc: # R. J. Mathar, Sep 15 2012