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!)
A244316 a(0) = 0, after which, if A176137(n) = 1, a(n) = A001511(A244230(n)), otherwise a(n) = a(n-A197433(A244230(n)-1)). 5
0, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 4, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 4, 1, 2, 1, 1, 3, 5, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 4, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 4, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 4, 1, 2, 1, 1, 3, 5, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 4, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
For n >= 1, a(n) tells the one-based position of the digit (from the right) where the iteration stopped at, when constructing a Semigreedy Catalan representation of n as described in A244159.
Algorithm for constructing the sequence: Find the largest Catalan number which is less than or equal to n (this is A081290(n) = A000108(k), where k = A244160(n), that is, the corresponding index of that Catalan number), and subtract that from n. Then check whether the previous Catalan number, C(m) = A000108(m), where m = k-1, exceeds the remaining n, and if it does not, then subtract that also from n, and keep on doing the same for lesser and lesser Catalan numbers, comparing and also subtracting them (whenever it is possible without going less than zero) from n, until either n becomes zero, or after subtracting C(1) = 1 from n, it still has not reached zero. In the latter case, find again the largest Catalan number which is less than or equal to remaining n, and start the process again. However, when at some point n finally reaches zero, then the index k of the last Catalan number, A000108(k) which was subtracted from n before it reached zero, is our result, a(n) = k. [Here n = the original value of n, from which we started subtracting initially from].
If n is one of the terms of A197433, meaning that if it can be represented as a sum of distinct Catalan numbers as n = C(i) + C(j) + ... + C(k) (which representation then necessarily is unique), then a(n) = min(i,j,...,k).
LINKS
FORMULA
a(0) = 0, and for n >= 1, if A176137(n) = 1, a(n) = A001511(A244230(n)), otherwise a(n) = a(n-A197433(A244230(n)-1)).
For n >= 1, a(n) = A244315(n)+1.
For n >= 1, a(A000108(n)) = n and a(A014138(n)) = a(A014143(n)) = 1.
PROG
(Scheme, with memoizing definec-macro from Antti Karttunen's IntSeq-library:)
(definec (A244316 n) (cond ((zero? n) n) ((not (zero? (A176137 n))) (A001511 (A244230 n))) (else (A244316 (- n (A197433 (-1+ (A244230 n))))))))
CROSSREFS
One more than A244315.
Sequence in context: A334302 A228531 A360056 * A076259 A260533 A107359
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 25 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 May 6 13:11 EDT 2024. Contains 372293 sequences. (Running on oeis4.)