The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A077267 Number of zeros in base-3 expansion of n. 26
 1, 0, 0, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 3, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 3, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 1, 0, 0, 4, 3, 3, 3, 2, 2, 3, 2, 2, 3, 2, 2, 2, 1, 1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,10 LINKS Reinhard Zumkeller, Table of n, a(n) for n = 0..10000 F. T. Adams-Watters, F. Ruskey, Generating Functions for the Digital Sum and Other Digit Counting Sequences, JIS 12 (2009) 09.5.6 Eric Weisstein's World of Mathematics, Ternary. Wikipedia, Ternary numeral system FORMULA a(1)=a(2)=0; a(3n)=a(n)+1; a(3n+1)=a(3n+2)=a(n). a(3^n-2)=a(3^n-1)=0; a(3^n)=n. a(n)=A077266(n, 3). a(n) + A062756(n) + A081603(n) = A081604(n). - Reinhard Zumkeller, Mar 23 2003 G.f.: (Sum_{k>=0} x^(3^(k+1))/(1 + x^(3^k) + x^(2*3^k)))/(1-x). - Franklin T. Adams-Watters, Nov 03 2005 a(n) = A079978(n) if n < 3, A079978(n) + a(floor(n/3)) otherwise. - Reinhard Zumkeller, Feb 21 2013 EXAMPLE a(8)=0 since 8 written in base 3 is 22 with 0 zeros; a(9)=2 since 9 written in base 3 is 100 with 2 zeros; a(10)=1 since 10 written in base 3 is 101 with 1 zero. MATHEMATICA Table[Count[IntegerDigits[n, 3], 0], {n, 0, 6!}] (* Vladimir Joseph Stephan Orlovsky, Jul 25 2009 *) DigitCount[Range[0, 110], 3, 0] (* Harvey P. Dale, Jul 04 2021 *) PROG (Haskell) a077267 n = a079978 n + if n < 3 then 0 else a077267 (n `div` 3) -- Reinhard Zumkeller, Feb 21 2013 CROSSREFS Cf. A023416, A077266, A062756, A081603. Cf. A007089, A081605, A032924, A081607, A081608, A077267, A134023. - Reinhard Zumkeller, Mar 23 2003 Sequence in context: A051556 A330166 A081602 * A134022 A262097 A085975 Adjacent sequences:  A077264 A077265 A077266 * A077268 A077269 A077270 KEYWORD base,nonn AUTHOR Henry Bottomley, Nov 01 2002 EXTENSIONS a(0)=1 added, offset changed to 0 and b-file adjusted by Reinhard Zumkeller, Feb 21 2013 Wrong formula deleted by Reinhard Zumkeller, Feb 21 2013 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 1 22:36 EDT 2021. Contains 346408 sequences. (Running on oeis4.)