login
A030350
a(n) = (# 1's)-(# 2's) in first n terms of A030341.
1
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,6
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
LINKS
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
CROSSREFS
Cf. A030341.
Sequence in context: A200323 A075370 A332297 * A026240 A124474 A282162
KEYWORD
nonn,look
EXTENSIONS
a(1) = 0 inserted by Robert Israel, Jun 23 2024
STATUS
approved