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.

A030350 a(n) = (# 1's)-(# 2's) in first n terms of A030341.

Original entry on oeis.org

0, 1, 0, 0, 1, 2, 3, 2, 3, 3, 2, 3, 2, 1, 0, 0, 0, 1, 2, 2, 3, 2, 2, 3, 3, 4, 5, 6, 7, 8, 7, 8, 9, 9, 8, 9, 10, 9, 10, 9, 8, 9, 9, 9, 8, 9, 9, 8, 7, 7, 6, 6, 7, 6, 7, 8, 7, 6, 7, 6, 6, 5, 4, 5, 4, 3, 2, 1, 0, 0, 0, 0, 1, 2, 2, 2, 3, 2, 2, 2, 3, 3, 4, 4, 5, 6, 7, 7, 8, 7
Offset: 1

Views

Author

Keywords

Comments

For k >= 1, a(3^k * (k - 1/2) + 1/2) = 1 and a(3^k * (k - 1/2) + 3/2) = a(3^k * (k - 1/2) + 5/2) = 0. - Robert Israel, Jun 23 2024

Crossrefs

Cf. A030341.

Programs

  • Maple
    R:= 0: t:= 0:
    for i from 1 to 100 do
      L:= convert(i,base,3);
      for j from 1 to nops(L) do
        if L[j] = 1 then t:= t+1 elif L[j] = 2 then t:= t-1 fi;
        R:= R,t;
      od
    od:
    R; # Robert Israel, Jun 23 2024

Extensions

a(1) = 0 inserted by Robert Israel, Jun 23 2024