The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A189820 a(3*k-2) = a(k), a(3*k-1) = a(k), a(3*k) = 1 for k >= 1, starting with a(1) = 0. 6
 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1 COMMENTS Together with A189816, this sequence completes the list of "type 3,3" sequences described at A189628. Alternate definition: a(n) = 1 if the ternary representation of n-1 has at least one "2" in it. Otherwise, a(n) = 0. Partial sums are given by A081610. - Nathaniel Johnston, May 17 2011 LINKS Antti Karttunen, Table of n, a(n) for n = 1..13122 Index entries for characteristic functions MATHEMATICA a[1] = 0; h = 180; Table[a[3 k - 2] = a[k], {k, 1, h}]; Table[a[3 k - 1] = a[k], {k, 1, h}]; Table[a[3 k] = 1, {k, 1, h}]; Table[a[n], {n, 1, h}] (* A189820 *) Flatten[Position[%, 0]] (* A003278 *) Flatten[Position[%%, 1]] (* A189822 *) PROG (PARI) a(n)=if(n<6, n==3, if(n%3, a(n\3+1), 1)) \\ Charles R Greathouse IV, Aug 11 2011 (Scheme) (define (A189820 n) (cond ((= 1 n) 0) ((zero? (modulo n 3)) 1) (else (A189820 (+ 1 (/ (- n (modulo n 3)) 3)))))) ;; Antti Karttunen, Aug 18 2017 CROSSREFS Cf. A081610, A189628, A003278, A189822. Sequence in context: A284388 A289174 A059125 * A111406 A353463 A260445 Adjacent sequences: A189817 A189818 A189819 * A189821 A189822 A189823 KEYWORD nonn,easy AUTHOR Clark Kimberling, Apr 28 2011 EXTENSIONS Typo in definition fixed by Reinhard Zumkeller, Aug 11 2011 STATUS approved

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

Last modified November 29 20:40 EST 2023. Contains 367447 sequences. (Running on oeis4.)