login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Today, Nov 11 2014, is the 4th anniversary of the launch of the new OEIS web site. 70,000 sequences have been added in these four years, all edited by volunteers. Please make a donation (tax deductible in the US) to help keep the OEIS running.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062756 Number of 1's in ternary (base 3) expansion of n. 28
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

Fixed point of the morphism : 0 ->010 ; 1 ->121 ; 2 ->232 ; ... ; n ->n(n+1)n , starting from a(0)=0. - From Philippe Deléham, Oct 25 2011.

LINKS

R. Zumkeller, Table of n, a(n) for n = 0..10000

Michael Gilleland, Some Self-Similar Integer Sequences

Robert Walker, Self Similar Sloth Canon Number Sequences

FORMULA

a(0) = 0, a(3n) = a(n), a(3n+1) = a(n)+1, a(3n+2) = a(n).

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.

a(n) = a(floor(n/3)) + [[n (mod 3)] (mod 2)]. - Paul D. Hanna, Feb 24 2006

MATHEMATICA

Table[Count[IntegerDigits[i, 3], 1], {i, 0, 200}]

Nest[Join[#, # + 1, #] &, {0}, 5] (* IWABUCHI Yu(u)ki, Sep 08 2012 *)

PROG

(PARI) a(n)=if(n<1, 0, a(n\3)+(n%3)%2) - Paul D. Hanna, Feb 24 2006

(Haskell)

a062756 0 = 0

a062756 n = a062756 n' + m `mod` 2 where (n', m) = divMod n 3

-- Reinhard Zumkeller, Feb 21 2013

CROSSREFS

Cf. A005823, A023693-A023697, A032924, A043321, A023692, A000120, A077267.

Cf. A080846, A081603.

Sequence in context: A030372 A065363 A119995 * A174695 A165577 A116422

Adjacent sequences:  A062753 A062754 A062755 * A062757 A062758 A062759

KEYWORD

nonn,base

AUTHOR

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 16 2001

EXTENSIONS

Formula and more terms from Vladeta Jovovic, Jul 18 2001

STATUS

approved

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

Content is available under The OEIS End-User License Agreement .

Last modified December 18 09:22 EST 2014. Contains 252122 sequences.