|
|
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
|
|
|
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
|
(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
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|