cp's OEIS Frontend

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.

A244316 a(0) = 0, after which, if A176137(n) = 1, a(n) = A001511(A244230(n)), otherwise a(n) = a(n-A197433(A244230(n)-1)).

Original entry on oeis.org

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
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

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).

Crossrefs

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.