This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A244161 #19 Mar 24 2021 09:52:21 %S A244161 0,1,4,5,8,16,17,20,21,24,32,33,36,37,64,65,68,69,72,80,81,84,85,88, %T A244161 96,97,100,101,128,129,132,133,136,144,145,148,149,152,160,161,164, %U A244161 165,256,257,260,261,264,272,273,276,277,280,288,289,292,293,320,321,324,325 %N A244161 Greedy Catalan Base (A014418) interpreted as base-4 numbers, then shown in decimal. %C A244161 This representation does not lose any information, because C(n+1)/C(n) [where C(n) is the n-th Catalan number, A000108(n)] approaches 4 from below, but never attains it. %C A244161 Analogously to "Fibbinary numbers", A003714, this sequence could be called "Catquaternary numbers". %H A244161 Indranil Ghosh, <a href="/A244161/b244161.txt">Table of n, a(n) for n = 0..1000</a> %F A244161 a(0) = 0, a(n) = 4^(A244160(n)-1) + a(n-A000108(A244160(n))). [Where A244160 gives the index of the largest Catalan number that still fits into the sum]. %F A244161 A000035(a(n)) = A000035(A014418(n)). [This sequence and the base-10 version are equal when reduced modulo 2]. %o A244161 (Scheme, with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library) %o A244161 ;; Version based on direct recurrence: %o A244161 (definec (A244161 n) (if (zero? n) n (+ (expt 4 (- (A244160 n) 1)) (A244161 (- n (A000108 (A244160 n))))))) %o A244161 (Python) %o A244161 from sympy import catalan %o A244161 def a244160(n): %o A244161 if n==0: return 0 %o A244161 i=1 %o A244161 while True: %o A244161 if catalan(i)>n: break %o A244161 else: i+=1 %o A244161 return i - 1 %o A244161 def a(n): %o A244161 if n==0: return 0 %o A244161 x=a244160(n) %o A244161 return 4**(x - 1) + a(n - catalan(x)) %o A244161 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 08 2017 %Y A244161 Cf. A000108, A014418, A003714, A085183, A085184, A244160. %K A244161 nonn %O A244161 0,3 %A A244161 _Antti Karttunen_, Jun 23 2014