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.

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.

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

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

Comments

For n >= 1, a(n) tells the zero-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.

Crossrefs

Formula

a(0) = 0, and for n >= 1, if A176137(n) = 1, a(n) = A007814(A244230(n)), otherwise a(n) = a(n-A197433(A244230(n)-1)).

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

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

A176137 Number of partitions of n into distinct Catalan numbers, cf. A000108.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 09 2010

Keywords

Comments

a(n) <= 1;
a(A000108(n)) = 1; a(A141351(n)) = 1; a(A014138(n)) = 1.
A197433 gives all such numbers k that a(k) = 1, in other words, this is the characteristic function of A197433, and all three sequences mentioned above are its subsequences. - Antti Karttunen, Jun 25 2014

Examples

			56 = 42+14 = A000108(5)+A000108(4), all other sums of distinct Catalan numbers are not equal 56, therefore a(56)=1.
		

Crossrefs

When right-shifted (prepended with 1) this sequence is the first differences of A244230.

Programs

Formula

a(n) = f(n,1,1) with f(m,k,c) = if c>m then 0^m else f(m-c,k+1,c') + f(m,k+1,c') where c'=2*c*(2*k+1)/(k+2).

A244232 Sum of "digit values" in Semigreedy Catalan Representation of n, A244159.

Original entry on oeis.org

0, 1, 1, 2, 3, 1, 2, 2, 3, 4, 4, 5, 6, 4, 1, 2, 2, 3, 4, 2, 3, 3, 4, 5, 5, 6, 7, 5, 6, 6, 7, 8, 8, 9, 10, 8, 5, 6, 6, 7, 8, 6, 1, 2, 2, 3, 4, 2, 3, 3, 4, 5, 5, 6, 7, 5, 2, 3, 3, 4, 5, 3, 4, 4, 5, 6, 6, 7, 8, 6, 7, 7, 8, 9, 9, 10, 11, 9, 6, 7, 7, 8, 9, 7, 8, 8, 9, 10, 10, 11, 12, 10, 11, 11, 12, 13, 13, 14, 15, 13, 10, 11, 11, 12, 13, 11, 6, 7, 7, 8, 9, 7, 8, 8, 9, 10, 10, 11, 12, 10, 7, 8, 8, 9, 10, 8, 9, 9, 10, 11, 11, 12, 1
Offset: 0

Views

Author

Antti Karttunen, Jun 25 2014

Keywords

Comments

Note that a(33604) = A000217(10) = 55 because the sum is computed from the underlying list (vector) of numbers, and thus is not subject to any corruption by decimal representation as A244159 itself is.
Equivalent description: partition n "greedily" as terms of A197433, i.e. n = A197433(i) + A197433(j) + ... + A197433(k), always using the largest term of A197433 that still "fits in" (i.e. is <= n remaining). Then a(n) = A000120(i) + A000120(j) + ... + A000120(k).

Examples

			For n=18, using the alternative description, we see that it is partitioned  into the terms of A197433 as a greedy sum A197433(11) + A197433(1) = 17 + 1. Thus a(18) = A000120(11) + A000120(1) = 3+1 = 4.
For n=128, we see that is likewise represented as A197433(31) + A197433(31) = 64 + 64. Thus a(128) = 2*A000120(31) = 10.
		

Crossrefs

Formula

If A176137(n) = 1, a(n) = A000120(A244230(n)), otherwise a(n) = A000120(A244230(n)-1) + a(n-A197433(A244230(n)-1)).
For all n, a(A000108(n)) = 1. [And moreover, Catalan numbers, A000108, give all such k that a(k) = 1].
For all n, a(A014138(n)) = n and a(A014143(n)) = A000217(n+1).
Showing 1-6 of 6 results.