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.

A037863 a(n) = (number of digits <=1) - (number of digits >1) in base 4 representation of n.

Original entry on oeis.org

1, -1, -1, 2, 2, 0, 0, 0, 0, -2, -2, 0, 0, -2, -2, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -3, -3, -1, -1, -3, -3, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -3, -3, -1, -1, -3, -3, 4, 4, 2, 2, 4, 4, 2, 2, 2, 2, 0, 0
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    A037863 := proc(n)
        a := 0 ;
        dgs := convert(n,base,4);
        for i from 1 to nops(dgs) do
            if op(i,dgs)<=1 then
                a := a+1 ;
            else
                a := a-1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Oct 16 2015
  • PARI
    a(n) = my(d=digits(n, 4)); #select(x->(x<=1), d) - #select(x->(x>1), d); \\ Michel Marcus, Jan 27 2025

Formula

a(n) = A110591(n)-2*A139352(n). - R. J. Mathar, Jan 27 2025