login
Binary complement of Greedy Catalan Base reduced modulo 2: a(n) = 1 - (A014418(n) modulo 2).
8

%I #14 Apr 09 2021 11:38:37

%S 1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,

%T 0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,

%U 1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,1

%N Binary complement of Greedy Catalan Base reduced modulo 2: a(n) = 1 - (A014418(n) modulo 2).

%H Antti Karttunen, <a href="/A244220/b244220.txt">Table of n, a(n) for n = 0..4862</a>

%F a(n) = 1 - A244221(n) = 1 - (A014418(n) modulo 2) = 1 - (A244161(n) modulo 2).

%o (Scheme) (define (A244220 n) (- 1 (A244221 n)))

%o (Python)

%o from sympy import catalan

%o def a244160(n):

%o if n==0: return 0

%o i=1

%o while True:

%o if catalan(i)>n: break

%o else: i+=1

%o return i - 1

%o def a(n):

%o if n==0: return 0

%o x=a244160(n)

%o return 10**(x - 1) + a(n - catalan(x))

%o print([1 - a(n)%2 for n in range(101)]) # _Indranil Ghosh_, Jun 08 2017

%Y Binary complement: A244221.

%Y A244226 gives the lengths of runs of identical terms.

%Y Cf. A014418, A244161.

%K nonn

%O 0

%A _Antti Karttunen_, Jun 23 2014