A120855 Row sums of triangle A120854, which is the matrix log of triangle A117939.
0, 2, 1, 2, 4, 3, 1, 3, 2, 2, 4, 3, 4, 6, 5, 3, 5, 4, 1, 3, 2, 3, 5, 4, 2, 4, 3, 2, 4, 3, 4, 6, 5, 3, 5, 4, 4, 6, 5, 6, 8, 7, 5, 7, 6, 3, 5, 4, 5, 7, 6, 4, 6, 5, 1, 3, 2, 3, 5, 4, 2, 4, 3, 3, 5, 4, 5, 7, 6, 4, 6, 5, 2, 4, 3, 4, 6, 5, 3, 5, 4, 2, 4, 3, 4, 6, 5, 3, 5, 4, 4, 6, 5, 6, 8, 7, 5, 7, 6, 3, 5, 4, 5, 7, 6
Offset: 0
Keywords
Programs
-
Mathematica
f[n_] := DigitCount[n, 3] /. {a_, b_, c_} -> 2a + b + 0c; Array[f, 105, 0] (* Robert G. Wilson v, Jul 31 2012 *)
-
PARI
{a(n)=local(M=matrix(n+1,n+1,r,c,(binomial(r-1,c-1)+1)%3-1)^2, L=sum(i=1,#M,-(M^0-M)^i/i));return(sum(k=0,n,L[n+1,k+1]))}
Comments