OFFSET
0,29
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..16796
FORMULA
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.
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.
Use the Scheme-program given in the Program sections of this entry and A239903 (the function A239903raw) to get correct results for all n.
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 22 2014
STATUS
approved