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.

This page as a plain text file.
%I A030350 #15 Jun 23 2024 14:31:05
%S A030350 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,
%T A030350 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,
%U A030350 1,0,0,0,0,1,2,2,2,3,2,2,2,3,3,4,4,5,6,7,7,8,7
%N A030350 a(n) = (# 1's)-(# 2's) in first n terms of A030341.
%C A030350 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
%H A030350 Robert Israel, <a href="/A030350/b030350.txt">Table of n, a(n) for n = 1..10000</a>
%p A030350 R:= 0: t:= 0:
%p A030350 for i from 1 to 100 do
%p A030350   L:= convert(i,base,3);
%p A030350   for j from 1 to nops(L) do
%p A030350     if L[j] = 1 then t:= t+1 elif L[j] = 2 then t:= t-1 fi;
%p A030350     R:= R,t;
%p A030350   od
%p A030350 od:
%p A030350 R; # _Robert Israel_, Jun 23 2024
%Y A030350 Cf. A030341.
%K A030350 nonn,look
%O A030350 1,6
%A A030350 _Clark Kimberling_
%E A030350 a(1) = 0 inserted by _Robert Israel_, Jun 23 2024