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

 

Logo
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
From Gabriele Fici, Mar 10 2024: (Start)
Fixed point of the substitution 0->001, 1->111.
An example of a Rote sequence, that is, it has exactly 2m distinct contiguous subsequences of length m, for every m >= 1. For example, there are 6 contiguous subsequences of length 3, namely 001, 010, 011, 100, 110, 111. (End)
LINKS
G. Rote, Sequences With Subword Complexity 2n, Journal of Number Theory, Volume 46, Issue 2, February 1994, pp. 196-213.
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}] (* this sequence *)
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
Sequence in context: A284388 A289174 A059125 * A111406 A353463 A260445
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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 13:38 EDT 2024. Contains 372212 sequences. (Running on oeis4.)