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.

Showing 1-6 of 6 results.

A244234 a(n) = n - A244232(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 4, 4, 5, 5, 5, 6, 6, 6, 9, 13, 13, 14, 14, 14, 17, 17, 18, 18, 18, 19, 19, 19, 22, 22, 23, 23, 23, 24, 24, 24, 27, 31, 31, 32, 32, 32, 35, 41, 41, 42, 42, 42, 45, 45, 46, 46, 46, 47, 47, 47, 50, 54, 54, 55, 55, 55, 58, 58, 59, 59, 59, 60, 60, 60
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

Crossrefs

Programs

A244159 Semigreedy Catalan Representation of nonnegative integers.

Original entry on oeis.org

0, 1, 10, 11, 12, 100, 101, 110, 111, 112, 121, 122, 123, 211, 1000, 1001, 1010, 1011, 1012, 1100, 1101, 1110, 1111, 1112, 1121, 1122, 1123, 1211, 1212, 1221, 1222, 1223, 1232, 1233, 1234, 1322, 2111, 2112, 2121, 2122, 2123, 2211, 10000
Offset: 0

Views

Author

Antti Karttunen, Jun 23 2014

Keywords

Comments

Algorithm for constructing the sequence: Define a(0) as 0, and for larger values of n, find first the largest Catalan number which is less than or equal to n [which is A081290(n)], and the index k = A244160(n), of that Catalan number. Initialize a vector of k zeros, [0, 0, ..., 0]. Set n_remaining = n - A000108(k) and add 1 to the leftmost element of vector, so that it will become [1, 0, ..., 0]. Then check whether the previous Catalan number, C(m) = A000108(m), where m = k-1, exceeds the n_remaining, and provided that C(m) <= n_remaining, then set n_remaining = n_remaining - C(m) and increment by one the m-th element of the vector (where the 1st element is the rightmost), otherwise just decrement m by one and keep on doing the same with lesser and lesser Catalan numbers, and whenever it is possible to subtract them from n_remaining (without going less than zero), do so and increment the corresponding m-th element of the vector, as long as either n_remaining becomes zero, or after subtracting C(1) = 1 from n_remaining, it still has not reached zero. In the latter case, find again the largest Catalan number which is less than or equal to n_remaining, and start the process again. However, after a finite number of such iterations, n_remaining will finally reach zero, and the result of a(n) is then the vector of numbers constructed, concatenated together and represented as a decimal number.
This shares with "Greedy Catalan Base" (A014418) the property that a simple weighted sum of Sum_{k=1..} digit(k)*C(k) recovers the natural number n, which the given numeral string like A014418(n) or here, a(n), represents. (Here C(k) = the k-th Catalan number, A000108(k), and digit(1) = the digit in the rightmost, least significant digit position.)
In this case, A244158(a(n)) = n holds for only up to 33603, after which comes the first representation containing a "digit" larger than nine, at a(33604), where the underlying string of numbers is [1,2,3,4,5,6,7,8,9,10] but the decimal system used here can no more unambiguously represent them.
On the other hand, with the given Scheme-functions, we always get n back with: (CatBaseSumVec (A244159raw n)).
For n >= 1, A014138(n) gives the positions of repunits: 1, 11, 111, 1111, ...
The "rep-2's": 22222, 222222, 2222222, 22222222, 222222222, ..., etc., occur in positions 128, 392, 1250, 4110, 13834, ... i.e. 2*A014138(n) for n >= 5.

Examples

			For n = 18, the largest Catalan number <= 18 is C(4) = 14.
Thus we initialize a vector of four zeros [0, 0, 0, 0] and increment the first element to 1: [1, 0, 0, 0] and subtract 14 from 18 to get the remainder 4.
We see that the next smaller Catalan number, C(3) = 5 is greater than 4, so we cannot subtract it without going negative, so the second leftmost element of the vector stays as zero.
We next check C(2) = 2, which is less than 4, thus we increment the zero at that point to 1, and subtract 4 - 2 to get 2.
We compare 2 to C(1) = 1, and as 1 <= 2, it is subtracted 2-1 = 1, and the corresponding element in the vector incremented, thus after the first round, the vector is now [1, 0, 1, 1], and n remaining is 1.
So we start the second round because n has not yet reached the zero, and look for the largest Catalan number <= 1, which in this case is C(1) = 1, so we subtract it from remaining n, and increment the element in the position 1, after which n has reached zero, and the vector is now [1, 0, 1, 2], whose concatenation as decimal numbers thus yields a(18) = 1012.
		

Crossrefs

Cf. A014418 (a classical greedy variant), A244231 (maximum "digit value"), A244232 (sum of digits), A244233 (product of digits), A244314 (positive terms which have at least one zero digit), A244316 (the one-based position of digit incremented last in the described process).
Differs from A239903 for the first time at n=10, where a(10) = 121, while A239903(10) = 120.

Formula

If A176137(n) = 1, a(n) = A007088(A244230(n)), otherwise a(n) = A007088(A244230(n)-1) + a(n-A197433(A244230(n)-1)).
For all n, a(A197433(n)) = A007088(n).
For all n >= 1, a(A000108(n)) = 10^(n-1).
Each a(A014143(n)) has a "triangular" representation [1, 2, 3, ..., n, n+1].

A014420 Minimal number of Catalan numbers that sum to n.

Original entry on oeis.org

0, 1, 1, 2, 2, 1, 2, 2, 3, 3, 2, 3, 3, 4, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 3, 4, 4, 5, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 4, 5, 5, 6, 1, 2, 2, 3, 3, 2, 3, 3, 4, 4, 3, 4, 4, 5, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 4, 5, 5, 6, 3, 4, 4, 5, 5, 4, 5, 5, 6, 6, 5, 6, 6, 7, 2, 3, 3, 4, 4, 3, 4, 4, 5, 5, 4, 5, 5, 6, 3
Offset: 0

Views

Author

Keywords

Crossrefs

Formula

a(0) = 0, a(n) = 1 + a(n-A081290(n)). - Antti Karttunen, Jul 02 2014

A197433 Sum of distinct Catalan numbers: a(n) = Sum_{k>=0} A030308(n,k)*C(k+1) where C(n) is the n-th Catalan number (A000108). (C(0) and C(1) not treated as distinct.)

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 8, 14, 15, 16, 17, 19, 20, 21, 22, 42, 43, 44, 45, 47, 48, 49, 50, 56, 57, 58, 59, 61, 62, 63, 64, 132, 133, 134, 135, 137, 138, 139, 140, 146, 147, 148, 149, 151, 152, 153, 154, 174, 175, 176, 177, 179, 180, 181, 182, 188, 189, 190, 191, 193, 194, 195, 196
Offset: 0

Views

Author

Philippe Deléham, Oct 15 2011

Keywords

Comments

Replace 2^k with A000108(k+1) in binary expansion of n.
From Antti Karttunen, Jun 22 2014: (Start)
On the other hand, A244158 is similar, but replaces 10^k with A000108(k+1) in decimal expansion of n.
This sequence gives all k such that A014418(k) = A239903(k), which are precisely all nonnegative integers k whose representations in those two number systems contain no digits larger than 1. From this also follows that this is a subsequence of A244155.
(End)

Crossrefs

Characteristic function: A176137.
Subsequence of A244155.
Cf. also A060112.
Other sequences that are built by replacing 2^k in binary representation with other numbers: A022290 (Fibonacci), A029931 (natural numbers), A059590 (factorials), A089625 (primes), A197354 (odd numbers).

Programs

  • Mathematica
    nmax = 63;
    a[n_] := If[n == 0, 0, SeriesCoefficient[(1/(1-x))*Sum[CatalanNumber[k+1]* x^(2^k)/(1 + x^(2^k)), {k, 0, Log[2, n] // Ceiling}], {x, 0, n}]];
    Table[a[n], {n, 0, nmax}] (* Jean-François Alcover, Nov 18 2021, after Ilya Gutkovskiy *)

Formula

For all n, A244230(a(n)) = n. - Antti Karttunen, Jul 18 2014
G.f.: (1/(1 - x))*Sum_{k>=0} Catalan number(k+1)*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jul 23 2017

Extensions

Name clarified by Antti Karttunen, Jul 18 2014

A244231 Maximum "digit" value in Semigreedy Catalan Representation of n, A244159.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 4, 3, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 4, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 4, 5, 4, 3, 3, 3, 3, 4, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 4, 3, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 1
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

Comments

The first value larger than nine occurs at a(33604) = 10. (33604 = A014143(9)). Note that this sequence is not subject to any corruption by decimal representation as A244159 itself is.
A014143 gives records up to that A014143(9) = 33604, but thereafter, the next record occurs at 57317, for which a(57317) = 11, although A014143(10) = 116103. This is explained by that A244159raw(57317) = [2,3,4,5,6,7,8,9,10,11] and A244159raw(116103) = [1,2,3,4,5,6,7,8,9,10,11] (where A244159raw means the underlying representation, before it is maimed by the decimal representation).
This change is explained by the fact that A014143(n-1) + A014138(n) > A000108(n+1) for n = 1..9, but for n >= 10, A014143(n-1) + A014138(n) < A000108(n+1).
For example, although 16808 = 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), its representation in A244159 system is 1000000123, as 16808 = 1*C(10) + 1*C(3) + 2*C(2) + 3*C(1).

Crossrefs

Programs

Formula

For all n, a(A000108(n)) = 1.
For all n >= 1, a(A014138(n)) = 1.
For all n, a(A014143(n)) = n+1.

A244233 Product of "digit values" in Semigreedy Catalan Representation of n, A244159.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 0, 0, 1, 2, 2, 4, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 4, 6, 2, 4, 4, 8, 12, 12, 18, 24, 12, 2, 4, 4, 8, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 4, 6, 2, 4, 4, 8, 12, 12, 18, 24, 12, 2, 4, 4, 8, 12, 4, 8, 8, 16, 24, 24, 36, 48, 24, 36, 36, 54, 72, 72, 96, 120, 72, 24, 36, 36, 54, 72, 36, 2, 4, 4, 8, 12, 4, 8, 8, 16, 24, 24, 36, 48, 24, 4, 8, 8, 16, 24, 8, 16, 16, 32, 48, 48, 72, 0
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

Comments

Note that a(33604) = 10! = 3628800 because the product is computed from the underlying list (vector) of numbers, and thus is not subject to any corruption by decimal representation as A244159 itself is.

Crossrefs

A244314 gives the positions of zeros.

Programs

Formula

For all n, a(A014138(n)) = 1 and a(A014143(n)) = A000142(n+1).
Showing 1-6 of 6 results.