login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A236855 a(n) is the sum of digits in A239903(n). 6
0, 1, 1, 2, 3, 1, 2, 2, 3, 4, 3, 4, 5, 6, 1, 2, 2, 3, 4, 2, 3, 3, 4, 5, 4, 5, 6, 7, 3, 4, 4, 5, 6, 5, 6, 7, 8, 6, 7, 8, 9, 10, 1, 2, 2, 3, 4, 2, 3, 3, 4, 5, 4, 5, 6, 7, 2, 3, 3, 4, 5, 3, 4, 4, 5, 6, 5, 6, 7, 8, 4, 5, 5, 6, 7, 6, 7, 8, 9, 7, 8, 9, 10, 11, 3, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
FORMULA
a(n) = A034968(x) - A060130(x), where x = A071155(A081291(n)).
For up to n = A000108(11)-2 = 58784, a(n) = A007953(A239903(n)).
Catalan numbers, A000108, give the positions of ones, and the n-th triangular number occurs for the first time at the position immediately before that, i.e., a(A001453(n)) = A000217(n-1).
For each n, a(n) >= A000217(A236859(n)).
EXAMPLE
As the 0th Catalan String is empty, indicated by A239903(0)=0, a(0)=0.
As the 18th Catalan String is [1,0,1,2] (A239903(18)=1012), a(18) = 1+0+1+2 = 4.
Note that although the range of validity of A239903 is inherently limited by the decimal representation employed, it doesn't matter here: We have a(58785) = 55, as the corresponding 58785th Catalan String is [1,2,3,4,5,6,7,8,9,10], even though A239903 cannot represent that unambiguously.
MATHEMATICA
A236855list[m_] := With[{r = 2*Range[2, m]-1}, Reverse[Map[Total[r-#] &, Select[Subsets[Range[2, 2*m-1], {m-1}], Min[r-#] >= 0 &]]]];
A236855list[6] (* Generates C(6) terms *) (* Paolo Xausa, Feb 19 2024 *)
PROG
(Scheme)
(define (A236855 n) (apply + (A239903raw n)))
(define (A239903raw n) (if (zero? n) (list) (let loop ((n n) (row (- (A081288 n) 1)) (col (- (A081288 n) 2)) (srow (- (A081288 n) 2)) (catstring (list 0))) (cond ((or (zero? row) (negative? col)) (reverse! (cdr catstring))) ((> (A009766tr row col) n) (loop n srow (- col 1) (- srow 1) (cons 0 catstring))) (else (loop (- n (A009766tr row col)) (+ row 1) col srow (cons (+ 1 (car catstring)) (cdr catstring))))))))
;; Alternative definition:
(define (A236855 n) (let ((x (A071155 (A081291 n)))) (- (A034968 x) (A060130 x))))
CROSSREFS
Sequence in context: A079087 A324920 A358638 * A244232 A227781 A366294
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Apr 18 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 09:18 EDT 2024. Contains 371935 sequences. (Running on oeis4.)