%I A062756
%S A062756 0,1,0,1,2,1,0,1,0,1,2,1,2,3,2,1,2,1,0,1,0,1,2,1,0,1,0,1,2,1,2,3,2,1,2,
%T A062756 1,2,3,2,3,4,3,2,3,2,1,2,1,2,3,2,1,2,1,0,1,0,1,2,1,0,1,0,1,2,1,2,3,2,1,
%U A062756 2,1,0,1,0,1,2,1,0,1,0,1,2,1,2,3,2,1,2,1,2,3,2,3,4,3,2,3,2,1,2,1,2,3,2
%N A062756 Number of 1's in ternary (base 3) expansion of n.
%H A062756 R. Zumkeller, <a href="b062756.txt">Table of n, a(n) for n = 0..10000</
a>
%H A062756 Michael Gilleland, <a href="selfsimilar.html">Some Self-Similar Integer
Sequences</a>
%F A062756 a(0) = 0, a(3n) = a(n), a(3n+1) = a(n)+1, a(3n+2) = a(n).
%F A062756 G.f.: (Sum_{k>=0} x^(3^k)/(1+x^(3^k)+x^(2*3^k)))/(1-x). In general, the
generating function for the number of digits equal to d in the base
b representation of n (0<d<b) is (Sum_{k>=0} x^(d*b^k)/(Sum_{0<=i<b}
x^(i*b^k)))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005 For d=0,
use the above formula with d=b: (Sum_{k>=0} x^(b^(k+1))/(Sum_{0<=i<b}
x^(i*b^k)))/(1-x), adding 1 if you consider the representation of
0 to have one zero digit.
%F A062756 a(n) = a(floor(n/3)) + [[n (mod 3)] (mod 2)]. - Paul D. Hanna (pauldhanna(AT)juno.com),
Feb 24 2006
%t A062756 Table[Count[IntegerDigits[i, 3], 1], {i, 0, 200}]
%o A062756 (PARI) a(n)=if(n<1,0,a(n\3)+(n%3)%2) - Paul D. Hanna (pauldhanna(AT)juno.com),
Feb 24 2006
%Y A062756 Cf. A005823, A023693-A023697, A032924, A043321, A023692, A000120, A077267.
%Y A062756 Cf. A080846.
%Y A062756 Sequence in context: A030372 A065363 A119995 this_sequence A165577 A116422
A130161
%Y A062756 Adjacent sequences: A062753 A062754 A062755 this_sequence A062757 A062758
A062759
%K A062756 nonn,base
%O A062756 0,5
%A A062756 Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 16 2001
%E A062756 Formula and more terms from Vladeta Jovovic (vladeta(AT)eunet.rs), Jul
18 2001
|