login
Parity of Greedy Catalan Base representation for n: a(n) = A014418(n) reduced modulo 2.
10

%I #15 Mar 24 2021 09:52:08

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

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

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

%N Parity of Greedy Catalan Base representation for n: a(n) = A014418(n) reduced modulo 2.

%C Also the rightmost digit in Catalan Base Representation A014418.

%C Characteristic function for A244223, numbers which have an "odd" representation in Greedy Catalan Base.

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

%F a(n) = A000035(A014418(n)) = A000035(A244161(n)).

%o (Scheme) (define (A244221 n) (A000035 (A244161 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([a(n)%2 for n in range(101)]) # _Indranil Ghosh_, Jun 08 2017

%Y Binary complement: A244220. Partial sums: A244225.

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

%Y Cf. A244223, A014418, A244161, A000035.

%K nonn

%O 0

%A _Antti Karttunen_, Jun 23 2014