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 A244157 #13 Sep 09 2017 19:30:42 %S A244157 0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,4,4,4,4,4,5, %T A244157 5,5,5,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1, %U A244157 1,1,4,4,4,4,4,5,5,5,5,7,7,7,7,7,14,14,14,14,14,14,14,14,14,14,15,15,15,15,18 %N A244157 a(n) = difference between n and the n-th Catalan restricted growth string [b_k, b_{k-1}, ..., b_2, b_1] (see A239903) when it is viewed as a simple numeral in Catalan Base: b_k*C(k) + b_{k-1}*C(k-1) + ... + b_2*C(2) +b_1*C(1). Here C(m) = A000108(m). %H A244157 Antti Karttunen, <a href="/A244157/b244157.txt">Table of n, a(n) for n = 0..16796</a> %F A244157 a(n) = n - A244158(A239903(n)) up to 58784, after which the "digits" in Catalan restricted growth strings grow larger than 9 and their decimal representation used in A239903 starts corrupting the results. %F A244157 At n=58785 (= C(11)-1, where C(k) = the k-th Catalan number, A000108(k)), the correct value for this sequence is a(58785) = 58785 - ((1*C(10)) + (2*C(9)) + (3*C(8)) + (4*C(7)) + (5*C(6)) + (6*C(5)) + (7*C(4)) + (8*C(3)) + (9*C(2)) + (10*C(1))) = 25181. %F A244157 Use the Scheme-program given in the Program sections of this entry and A239903 (the function A239903raw) to get correct results for all n. %o A244157 (Scheme) %o A244157 (define (A244157 n) (- n (CatBaseSum (A239903raw n)))) ;; A239903raw given in A239903. %o A244157 (define (CatBaseSum lista) (let loop ((digits (reverse lista)) (i 1) (s 0)) (if (null? digits) s (loop (cdr digits) (+ i 1) (+ s (* (car digits) (A000108 i))))))) %Y A244157 A244155 gives the positions of zeros, A244156 the positions of nonzeros. %Y A244157 Cf. A000108, A239903, A014418, A244158. %K A244157 nonn %O A244157 0,29 %A A244157 _Antti Karttunen_, Jun 22 2014